From 778d2d4403a3d92302d91c39c6c97cf3273de9ce Mon Sep 17 00:00:00 2001 From: Gabriel Liwerant Date: Thu, 3 Oct 2019 01:27:25 -0400 Subject: [PATCH] Upgrade testing performance and simplify This test sometimes times out when the test suite is run due to the way it is building new array data. It turns out that we don't need a new data set for this test, as we can use smaller rows per page number to get the same result on the existing data set in the test suite. --- test/MUIDataTable.test.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/MUIDataTable.test.js b/test/MUIDataTable.test.js index c6265ecd0..99273293e 100644 --- a/test/MUIDataTable.test.js +++ b/test/MUIDataTable.test.js @@ -902,15 +902,16 @@ describe('', function() { }); it('should recalculate page when calling changeRowsPerPage method', () => { - const data = new Array(29).fill('').map(() => ['Joe James', 'Test Corp', 'Yonkers', 'NY']); - const mountWrapper = mount(shallow().get(0)); + const mountWrapper = mount(shallow().get(0)); const instance = mountWrapper.instance(); - instance.changePage(2); - instance.changeRowsPerPage(15); - - const state = mountWrapper.state(); + instance.changePage(1); + let state = mountWrapper.state(); assert.equal(state.page, 1); + + instance.changeRowsPerPage(4); + state = mountWrapper.state(); + assert.equal(state.page, 0); }); it('should update page position when calling changePage method', () => {