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
| var MAX_DEPTH_OF_CHECK = 6; | |
| function objectsAreEqual(first, second, depthOfCheck) { | |
| var isFirstObject = isObject(first); | |
| var isSecondObject = isObject(second); | |
| if (!isFirstObject && !isSecondObject) { // both are not objects, compare primitives | |
| return first === second; | |
| } else if (!isFirstObject || !isSecondObject) { // one of them is not object | |
| return false; | |
| } |
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
| function getStyle(elem, prop) { | |
| return window.getComputedStyle(elem).getPropertyValue(prop); | |
| } | |
| function bodyOffset( body ) { | |
| let top = body.offsetTop, | |
| left = body.offsetLeft; | |
| let doesNotIncludeMarginInBodyOffset; // TODO | |
| if (doesNotIncludeMarginInBodyOffset ) { | |
| top += parseFloat( getStyle(body, 'marginTop') ) || 0; |
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
| beforeEach(function() { | |
| jasmine.addMatchers(getCustomMatcher()); | |
| }); | |
| function getCustomMatcher() { | |
| function createCustomMatcher(arg, util, customEqualityTesters) { | |
| return sinon.match(function (val) { | |
| return util.equals(val, arg, customEqualityTesters); |