From 2d85f2df128f8f20b58a88f7d6bddc5dbea8f2e0 Mon Sep 17 00:00:00 2001 From: Joe Reuter Date: Fri, 19 Aug 2022 12:18:47 +0200 Subject: [PATCH] fix test --- .../datatable/components/table_basic.test.tsx | 31 ++++--------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.test.tsx b/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.test.tsx index 6f5ecaba93ea2..7ab05fc5ce24f 100644 --- a/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.test.tsx +++ b/x-pack/plugins/lens/public/visualizations/datatable/components/table_basic.test.tsx @@ -739,7 +739,9 @@ describe('DatatableComponent', () => { it('enables pagination', async () => { const { data, args } = sampleArgs(); - args.pageSize = 10; + data.rows = new Array(10).fill({ a: 'shoes', b: 1588024800000, c: 3 }); + + args.pageSize = 2; const wrapper = mount( { it('resets page position if rows change so page will be empty', async () => { const { data, args } = sampleArgs(); - data.rows = [ - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - ]; + data.rows = new Array(10).fill({ a: 'shoes', b: 1588024800000, c: 3 }); args.pageSize = 2; @@ -809,17 +804,7 @@ describe('DatatableComponent', () => { wrapper.setProps({ data: { ...data, - rows: [ - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - ], + rows: new Array(20).fill({ a: 'shoes', b: 1588024800000, c: 3 }), }, }); @@ -831,11 +816,7 @@ describe('DatatableComponent', () => { wrapper.setProps({ data: { ...data, - rows: [ - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - { a: 'shoes', b: 1588024800000, c: 3 }, - ], + rows: new Array(3).fill({ a: 'shoes', b: 1588024800000, c: 3 }), }, });