Created
June 12, 2013 10:09
-
-
Save justinvdm/5764179 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/go/base/static/js/test/tests/components/views.test.js b/go/base/static/js/test/tests/components/views.test.js | |
index 2342634..30c9f56 100644 | |
--- a/go/base/static/js/test/tests/components/views.test.js | |
+++ b/go/base/static/js/test/tests/components/views.test.js | |
@@ -17,6 +17,12 @@ describe("go.components.views", function() { | |
var label; | |
+ var assertOffset = function(el, expectedOffset) { | |
+ var offset = $(el).offset(); | |
+ assert.closeTo(offset.top, expectedOffset.top, 1); | |
+ assert.closeTo(offset.left, expectedOffset.left, 1); | |
+ }; | |
+ | |
beforeEach(function() { | |
$('#dummy') | |
.width(200) | |
@@ -40,9 +46,7 @@ describe("go.components.views", function() { | |
it("should position the label at the given position", function() { | |
label.render(); | |
- assert.deepEqual( | |
- $('#dummy .label').offset(), | |
- {left: 21, top: 73}); | |
+ assertOffset('#dummy .label', {left: 21, top: 73}); | |
}); | |
it("should render the given text", function() { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1