Bläddra i källkod

dimensions are slightly different with table cell elements. make dimension tests more forgiving

Adam Shaw 8 år sedan
förälder
incheckning
86cd484772
1 ändrade filer med 4 tillägg och 4 borttagningar
  1. 4 4
      tests/lib/jasmine-ext.js

+ 4 - 4
tests/lib/jasmine-ext.js

@@ -108,7 +108,7 @@ beforeEach(function() {
 					var otherBounds = getBounds(expected);
 					var result = {
 						pass: subjectBounds && otherBounds &&
-							Math.round(subjectBounds.right) <= Math.round(otherBounds.left)
+							Math.round(subjectBounds.right) <= Math.round(otherBounds.left) + 2
 							// need to round because IE was giving weird fractions
 					};
 					if (!result.pass) {
@@ -125,7 +125,7 @@ beforeEach(function() {
 					var otherBounds = getBounds(expected);
 					var result = {
 						pass: subjectBounds && otherBounds &&
-							Math.round(subjectBounds.left) >= Math.round(otherBounds.right)
+							Math.round(subjectBounds.left) >= Math.round(otherBounds.right) - 2
 							// need to round because IE was giving weird fractions
 					};
 					if (!result.pass) {
@@ -142,7 +142,7 @@ beforeEach(function() {
 					var otherBounds = getBounds(expected);
 					var result = {
 						pass: subjectBounds && otherBounds &&
-							Math.round(subjectBounds.bottom) <= Math.round(otherBounds.top)
+							Math.round(subjectBounds.bottom) <= Math.round(otherBounds.top) + 2
 							// need to round because IE was giving weird fractions
 					};
 					if (!result.pass) {
@@ -159,7 +159,7 @@ beforeEach(function() {
 					var otherBounds = getBounds(expected);
 					var result = {
 						pass: subjectBounds && otherBounds &&
-							Math.round(subjectBounds.top) >= Math.round(otherBounds.bottom)
+							Math.round(subjectBounds.top) >= Math.round(otherBounds.bottom) - 2
 							// need to round because IE was giving weird fractions
 					};
 					if (!result.pass) {