Skip to content

Commit 0873278

Browse files
committed
chore: Fix flaky resizable column test
1 parent a6cdcd0 commit 0873278

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/table/__integ__/resizable-columns.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0
33

4+
import { waitFor } from '@testing-library/react';
5+
46
import { BasePageObject } from '@cloudscape-design/browser-test-tools/page-objects';
57
import useBrowser from '@cloudscape-design/browser-test-tools/use-browser';
68

@@ -345,8 +347,10 @@ test(
345347
await page.resizeColumn(2, 100);
346348
const oldWidth = await page.getColumnWidth(2);
347349
await page.click('#reset-state');
348-
const newWidth = await page.getColumnWidth(2);
349-
expect(oldWidth).toEqual(newWidth);
350+
await waitFor(async () => {
351+
const newWidth = await page.getColumnWidth(2);
352+
expect(oldWidth).toEqual(newWidth);
353+
});
350354
})
351355
);
352356

0 commit comments

Comments
 (0)