Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/table/__integ__/resizable-columns.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ const tableWrapper = wrapper.findTable();
// All the columns fit in the viewport, which make it easier to test the columns' widths
const defaultScreen = { width: 1680, height: 800 };

function delay() {
return new Promise(resolve => setTimeout(resolve));
}

class TablePage extends BasePageObject {
async resizeColumn(columnIndex: number, xOffset: number) {
const resizerSelector = tableWrapper.findColumnResizer(columnIndex).toSelector();
Expand All @@ -46,7 +50,7 @@ class TablePage extends BasePageObject {

async getColumnWidth(columnIndex: number) {
const columnSelector = tableWrapper.findColumnHeaders().get(columnIndex).toSelector();
const element = await this.browser.$(columnSelector);
const element = this.browser.$(columnSelector);
const size = await element.getSize();
return size.width;
}
Expand Down Expand Up @@ -345,6 +349,7 @@ test(
await page.resizeColumn(2, 100);
const oldWidth = await page.getColumnWidth(2);
await page.click('#reset-state');
await delay();
const newWidth = await page.getColumnWidth(2);
expect(oldWidth).toEqual(newWidth);
})
Expand Down
Loading