Skip to content

Commit

Permalink
test: update test
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Sep 12, 2023
1 parent b939c6f commit b69c068
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion tests/Virtual.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ describe('Table.Virtual', () => {
scroll: {} as any,
});

expect(errSpy).toHaveBeenCalledWith('Warning: `scroll.x` in virtual table must be number.');
expect(errSpy).toHaveBeenCalledWith('Warning: `scroll.y` in virtual table must be number.');
});

Expand Down Expand Up @@ -226,4 +225,23 @@ describe('Table.Virtual', () => {

expect(container.querySelector('.bamboo').textContent).toEqual('0');
});

it('columns less than width', async () => {
const { container } = getTable({
columns: [{}, {}],
scroll: {
y: 10,
},
getContainerWidth: () => 200,
data: [{}],
});

resize(container.querySelector('.rc-table'));

await waitFakeTimer();

expect(container.querySelectorAll('col')).toHaveLength(2);
expect(container.querySelectorAll('col')[0]).toHaveStyle({ width: '100px' });
expect(container.querySelectorAll('col')[1]).toHaveStyle({ width: '100px' });
});
});

0 comments on commit b69c068

Please sign in to comment.