Bump react-grid-layout (#15067)

* Bump react-grid-layout

* Restore getSelection mock after test
This commit is contained in:
Jonathan Budzenski 2017-11-28 14:27:22 -06:00 committed by Jonathan Budzenski
parent 958a4f6026
commit 5ad0cda0d7
No known key found for this signature in database
GPG key ID: D28BF9418FA0F292
2 changed files with 12 additions and 1 deletions

View file

@ -173,7 +173,7 @@
"react-anything-sortable": "1.6.1",
"react-color": "2.11.7",
"react-dom": "15.6.1",
"react-grid-layout": "0.14.7",
"react-grid-layout": "0.16.0",
"react-input-autosize": "1.1.0",
"react-input-range": "1.2.1",
"react-markdown": "2.4.2",

View file

@ -25,14 +25,25 @@ function createOldPanelData(col, id, row, sizeX, sizeY, panelIndex) {
return { col, id, row, size_x: sizeX, size_y: sizeY, type: 'visualization', panelIndex };
}
const getSelection = window.getSelection;
beforeAll(() => {
// sizeme detects the width to be 0 in our test environment. noPlaceholder will mean that the grid contents will
// get rendered even when width is 0, which will improve our tests.
sizeMe.noPlaceholders = true;
// react-grid-layout calls getSelection which isn't support by jsdom
// it's called regardless of whether we need to remove selection,
// and in this case we don't need to remove selection
window.getSelection = () => {
return {
removeAllRanges: () => {}
};
};
});
afterAll(() => {
sizeMe.noPlaceholders = false;
window.getSelection = getSelection;
});
test('loads old panel data in the right order', () => {