Skip to content

Commit

Permalink
Fix up some e2e tests
Browse files Browse the repository at this point in the history
- Throw if gridLocation is null, removes some unnecessary null checks
- Have a little wait after getting the grid location, looks like we think it's loaded before it actually is
  - There should be a more robust way to do this, this is not the best.
  • Loading branch information
mofojed committed Sep 11, 2024
1 parent 872f305 commit 8966c29
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/table-multiselect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ async function getGridLocation(page: Page) {
const grid = await page.locator('.iris-grid-panel .iris-grid');
const gridLocation = await grid.boundingBox();
expect(gridLocation).not.toBeNull();
if (gridLocation === null) {
throw new Error('Grid location is null');
}
// TODO: We shouldn't need this wait. We seem to be thinking the grid is loaded before it actually is.
await page.waitForTimeout(100);
return gridLocation;
}

Expand Down Expand Up @@ -78,7 +83,6 @@ function runSpecialSelectFilter(
await gotoPage(page, '');
await openTable(page, `multiselect_${columnType}`);
const gridLocation = await getGridLocation(page);
if (gridLocation === null) return;

await page.mouse.click(
gridLocation.x + 1,
Expand All @@ -105,7 +109,6 @@ function runMultiSelectFilter(
await gotoPage(page, '');
await openTable(page, `multiselect_${columnType}`);
const gridLocation = await getGridLocation(page);
if (gridLocation === null) return;

// activate the quick filter to get that text as well
await test.step('Show quick filter step', async () => {
Expand Down Expand Up @@ -168,7 +171,6 @@ test('char formatting, non selected right click, preview formatting', async ({
await gotoPage(page, '');
await openTable(page, 'multiselect_char');
const gridLocation = await getGridLocation(page);
if (gridLocation === null) return;

// select row 2, 4
await page.keyboard.down('Control');
Expand Down

0 comments on commit 8966c29

Please sign in to comment.