wait in advance and avoid race condition (#20311)

This commit is contained in:
Vijay authored and GitHub committed 2025-03-22 14:56:01 +05:30
1 parent 56ab4e8415
commit 41041226b4
1 file changed
+4 -2
+4 -2
View File
@@ -351,11 +351,13 @@ test.describe("Bookings", () => {
await page.locator('[data-testid="add-filter-item-userId"]').click();
await page.locator('[data-testid="filter-popover-trigger-userId"]').click();
const bookingsGetResponse2 = page.waitForResponse((response) =>
/\/api\/trpc\/bookings\/get.*/.test(response.url())
);
await page
.locator(`[data-testid="multi-select-options-userId"] [role="option"]:has-text("${thirdUser.name}")`)
.click();
await page.waitForResponse((response) => /\/api\/trpc\/bookings\/get.*/.test(response.url()));
await bookingsGetResponse2;
//expect only 3 bookings (out of 4 total) to be shown in list.
//where ThirdUser is either organizer or attendee