Skip to content

Commit 97e2bbd

Browse files
committed
fix: added extra check to testFilterPresence (#4068)
1 parent 258c238 commit 97e2bbd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

explorer/e2e/testFunctions.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,17 @@ export async function testFilterPresence(
223223
page: Page,
224224
tab: TabDescription
225225
): Promise<void> {
226+
// Goto the selected tab
226227
await page.goto(tab.url);
227228
await expect(page.getByRole("tab").getByText(tab.tabName)).toBeVisible();
228229
for (const filter of anvilFilters) {
229-
await page.getByText(filter_regex(filter)).click(); // maybe should select a random one instead;
230+
// Check that each filter is visible and clickable
231+
await expect(page.getByText(filter_regex(filter))).toBeVisible();
232+
await page.getByText(filter_regex(filter)).click();
230233
await expect(page.getByRole("checkbox").first()).not.toBeChecked();
234+
// Check that clicking out of the filter menu causes it to disappear
231235
await page.locator("body").click();
236+
await expect(page.getByRole("checkbox")).toHaveCount(0);
232237
}
233238
}
234239

0 commit comments

Comments
 (0)