Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieJ committed Sep 19, 2023
1 parent fd15461 commit bf5a90f
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/Virtual.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ describe('Table.Virtual', () => {
},
],
scroll: {
x: 1128,
x: 100,
y: 10,
},
data: [{}],
Expand Down Expand Up @@ -247,4 +247,25 @@ describe('Table.Virtual', () => {
expect(container.querySelectorAll('col')[0]).toHaveStyle({ width: '100px' });
expect(container.querySelectorAll('col')[1]).toHaveStyle({ width: '100px' });
});

it('should fill width as scrollX if scrollX is larger', async () => {
const { container } = getTable({
columns: [
{
width: 100,
},
],
scroll: {
x: 1128,
y: 10,
},
getContainerWidth: () => 200,
data: [{}],
});

expect(container.querySelector('.rc-virtual-list')).toHaveAttribute(
'data-scroll-width',
'1128',
);
});
});

0 comments on commit bf5a90f

Please sign in to comment.