forked from schrodinger/fixed-data-table-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not crash when unsetting scrollToRow (schrodinger#62)
* Do not crash when unsetting scrollToRow * Adding semicolons * Adding more tests and fixing for scrollTop * CR feedback
- Loading branch information
1 parent
53df937
commit 79db986
Showing
5 changed files
with
100 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict' | ||
|
||
var jsdom = require('jsdom'); | ||
|
||
// setup the simplest document possible | ||
var doc = jsdom.jsdom('<!doctype html><html><body></body></html>'); | ||
|
||
// get the window object out of the document | ||
var win = doc.defaultView; | ||
|
||
// set globals for mocha that make access to document and window feel | ||
// natural in the test environment | ||
global.document = doc; | ||
global.window = win; | ||
|
||
// take all properties of the window object and also attach it to the | ||
// mocha global object | ||
propagateToGlobal(win); | ||
|
||
// from mocha-jsdom https://github.com/rstacruz/mocha-jsdom/blob/master/index.js#L80 | ||
function propagateToGlobal (window) { | ||
for (let key in window) { | ||
if (!window.hasOwnProperty(key) || key in global) { | ||
continue; | ||
} | ||
|
||
global[key] = window[key]; | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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