mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test(docs): make search and nav e2e tests hydration-aware (#551)
The docs e2e suite clicked navbar and sidebar controls before Vue hydrated the multi-locale bundle, so the clicks were swallowed. That raced the Pagefind search open (filed as #551), the appearance toggle, and the homepage and sidebar navigation tests. The old search tests also matched an input placeholder the config overrides, so they failed against a working build. Add a waitForHydration helper (gates on #app.__vue_app__, set inside Vue's app.mount()) and an openDocsSearch helper, and route the affected tests through them. Search itself was never broken; this change is test-only. Docs e2e suite is green (43/43). Closes #551
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// tests/e2e-docs/i18n.spec.ts
|
||||
import { expect, test } from "@playwright/test";
|
||||
import { openDocsSearch } from "./helpers";
|
||||
|
||||
test.describe("docs i18n (English + seeded German locale)", () => {
|
||||
test("English home still renders at root", async ({ page }) => {
|
||||
@@ -50,9 +51,8 @@ test.describe("docs i18n (English + seeded German locale)", () => {
|
||||
|
||||
test("pagefind returns results within the German locale", async ({ page }) => {
|
||||
await page.goto("/de/guide/getting-started");
|
||||
await page.locator(".blog-search").first().click();
|
||||
const input = page.locator("input[placeholder]").first();
|
||||
const input = await openDocsSearch(page);
|
||||
await input.fill("docker");
|
||||
await expect(page.locator('[role="option"]').first()).toBeVisible({ timeout: 10000 });
|
||||
await expect(page.locator('[role="option"]').first()).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user