Skip to content

Commit

Permalink
well that actually worked, let's clean it up
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-s-nava committed Oct 21, 2024
1 parent d720e0d commit 90608b1
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions frontend/tests/e2e/search/search-loading.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,22 @@ import {
} from "tests/e2e/search/searchSpecUtil";

test.describe("Search page tests", () => {
// test.beforeEach(async ({ page }: { page: Page }) => {
// // Navigate to the search page with the feature flag set
// await page.goto("/search?_ff=showSearchV0:true");
// });

test("should show and hide loading state", async () => {
const searchTerm = generateRandomString([4, 5]);
const searchTerm2 = generateRandomString([8]);

const browser = await chromium.launch({ slowMo: 100 });

const page = await browser.newPage();
await page.goto("/search?_ff=showSearchV0:true");
// if this doesn't work we can try https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-slow-mo
const searchTerm = generateRandomString([4, 5]);
const loadingIndicator = page.getByTestId("loading-message");
// await Promise.all([
// fillSearchInputAndSubmit(searchTerm, page),
// expect(loadingIndicator).toBeVisible(),
// ]);

await fillSearchInputAndSubmit(searchTerm, page);
await expect(loadingIndicator).toBeVisible();
await expect(loadingIndicator).toBeHidden();

// const searchTerm2 = generateRandomString([8]);
// await Promise.all([
// fillSearchInputAndSubmit(searchTerm2, page),
// expect(loadingIndicator).toBeVisible(),
// ]);
// await expect(loadingIndicator).toBeHidden();
await fillSearchInputAndSubmit(searchTerm2, page);
await expect(loadingIndicator).toBeVisible();
await expect(loadingIndicator).toBeHidden();
});
});

0 comments on commit 90608b1

Please sign in to comment.