{
const colWidth = index === columns.length - 1 ? (width as number) - scrollbarSize : width;
if (typeof colWidth === 'number' && !Number.isNaN(colWidth)) {
diff --git a/tests/FixedColumn.spec.js b/tests/FixedColumn.spec.js
index 6ec93163c..e0bff211e 100644
--- a/tests/FixedColumn.spec.js
+++ b/tests/FixedColumn.spec.js
@@ -49,29 +49,45 @@ describe('Table.FixedColumn', () => {
{ scrollName: 'scrollX', scroll: { x: 1200 } },
{ scrollName: 'scrollXY', scroll: { x: 1200, y: 100 } },
].forEach(({ scrollName, scroll }) => {
- [{ name: 'with data', data }, { name: 'without data', data: [] }].forEach(
- ({ name, data: testData }) => {
- it(`${scrollName} - ${name}`, async () => {
- jest.useFakeTimers();
- const wrapper = mount();
-
- act(() => {
- wrapper
- .find('table ResizeObserver')
- .first()
- .props()
- .onResize({ width: 93, offsetWidth: 93 });
- });
- await act(async () => {
- jest.runAllTimers();
- await Promise.resolve();
- wrapper.update();
- });
- expect(wrapper.render()).toMatchSnapshot();
- jest.useRealTimers();
+ [
+ { name: 'with data', data },
+ { name: 'without data', data: [] },
+ ].forEach(({ name, data: testData }) => {
+ it(`${scrollName} - ${name}`, async () => {
+ jest.useFakeTimers();
+ const wrapper = mount();
+
+ act(() => {
+ wrapper
+ .find('table ResizeObserver')
+ .first()
+ .props()
+ .onResize({ width: 93, offsetWidth: 93 });
});
- },
+ await act(async () => {
+ jest.runAllTimers();
+ await Promise.resolve();
+ wrapper.update();
+ });
+ expect(wrapper.render()).toMatchSnapshot();
+ jest.useRealTimers();
+ });
+ });
+ });
+
+ it('all column has width should use it', () => {
+ const wrapper = mount(
+ ,
);
+
+ expect(wrapper.find('colgroup').render()).toMatchSnapshot();
});
});
diff --git a/tests/__snapshots__/FixedColumn.spec.js.snap b/tests/__snapshots__/FixedColumn.spec.js.snap
index ff835cedb..b0b7529ce 100644
--- a/tests/__snapshots__/FixedColumn.spec.js.snap
+++ b/tests/__snapshots__/FixedColumn.spec.js.snap
@@ -695,6 +695,17 @@ exports[`Table.FixedColumn fixed column renders correctly RTL 1`] = `
`;
+exports[`Table.FixedColumn renders correctly all column has width should use it 1`] = `
+
+
+
+
+`;
+
exports[`Table.FixedColumn renders correctly scrollX - with data 1`] = `
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-