diff options
Diffstat (limited to 'tests/test.display.js')
-rw-r--r-- | tests/test.display.js | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/test.display.js b/tests/test.display.js index d54cb82..56dfc22 100644 --- a/tests/test.display.js +++ b/tests/test.display.js @@ -28,35 +28,29 @@ describe('Display/Canvas Helper', function () { describe('checking for cursor uri support', function () { beforeEach(function () { - this._old_change_cursor = Display.changeCursor; + this._old_browser_supports_cursor_uris = Util.browserSupportsCursorURIs; }); it('should disable cursor URIs if there is no support', function () { - Display.changeCursor = function(target) { - target.style.cursor = undefined; - }; + Util.browserSupportsCursorURIs = function () { return false; }; var display = new Display({ target: document.createElement('canvas'), prefer_js: true, viewport: false }); expect(display._cursor_uri).to.be.false; }); it('should enable cursor URIs if there is support', function () { - Display.changeCursor = function(target) { - target.style.cursor = 'pointer'; - }; + Util.browserSupportsCursorURIs = function () { return true; }; var display = new Display({ target: document.createElement('canvas'), prefer_js: true, viewport: false }); expect(display._cursor_uri).to.be.true; }); it('respect the cursor_uri option if there is support', function () { - Display.changeCursor = function(target) { - target.style.cursor = 'pointer'; - }; + Util.browserSupportsCursorURIs = function () { return false; }; var display = new Display({ target: document.createElement('canvas'), prefer_js: true, viewport: false, cursor_uri: false }); expect(display._cursor_uri).to.be.false; }); afterEach(function () { - Display.changeCursor = this._old_change_cursor; + Util.browserSupportsCursorURIs = this._old_browser_supports_cursor_uris; }); }); |