Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
flash1293 committed Aug 19, 2022
1 parent fd6aada commit 2d85f2d
Showing 1 changed file with 6 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<DatatableComponent
Expand Down Expand Up @@ -775,14 +777,7 @@ describe('DatatableComponent', () => {
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;

Expand All @@ -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 }),
},
});

Expand All @@ -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 }),
},
});

Expand Down

0 comments on commit 2d85f2d

Please sign in to comment.