diff --git a/src/app.html b/src/app.html index 21c9ff3..c00d228 100644 --- a/src/app.html +++ b/src/app.html @@ -5,6 +5,9 @@ + %sveltekit.head% diff --git a/src/lib/components/family.svelte b/src/lib/components/family.svelte index 9df7848..bf0270b 100644 --- a/src/lib/components/family.svelte +++ b/src/lib/components/family.svelte @@ -1,7 +1,11 @@
me, my wife, dog, and two cats diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 220f0d1..e02f481 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,76 +1,160 @@ -{#each commands as command} -
-

- aj@rva $ - {command.text} -

-
- + + + + +
+ {#each commands as command} +
+ +
+ +
+ {/each} +
+ +{#if useAnimation} + -{/each} - -{#if currentCommand} -

- aj@rva $ - {currentCommand.text.slice(0, currentCommandIndex)}_ -

- -{:else} -

- aj@rva $ - _ -

{/if} + + diff --git a/tests/hi.spec.ts b/tests/hi.spec.ts index 31a4de7..4dea919 100644 --- a/tests/hi.spec.ts +++ b/tests/hi.spec.ts @@ -5,28 +5,44 @@ test.beforeEach(async ({ page }) => { }); test("first paragraph shows up", async ({ page }) => { - const target = page - .getByRole("paragraph") - .filter({ hasText: "Hey!" }) - .first(); + const target = page.locator("p:visible", { hasText: "Hey!" }).first(); await expect(target).toBeVisible(); }); test("second paragraph shows up", async ({ page }) => { const target = page - .getByRole("paragraph") - .filter({ hasText: "This is my little corner of the internet" }) + .locator("p:visible", { + hasText: "This is my little corner of the internet", + }) .first(); await expect(target).toBeVisible(); }); test("photo shows up", async ({ page }) => { const text = page - .getByRole("paragraph") - .filter({ hasText: "picture of me, my wife, and all my pets" }) + .locator("p:visible", { + hasText: "picture of me, my wife, and all my pets", + }) + .first(); + const image = page + .locator('img[alt="me, my wife, dog, and two cats"]:visible') .first(); - const image = page.getByAltText("me, my wife, dog, and two cats").first(); await expect(text).toBeVisible({ timeout: 10000 }); await expect(image).toBeVisible(); }); + +test.describe("without JavaScript", () => { + test.use({ javaScriptEnabled: false }); + + test("home content is visible", async ({ page }) => { + await expect(page.getByTestId("home-content")).toBeVisible(); + await expect(page.getByText("Hey!").first()).toBeVisible(); + await expect( + page.getByText("This is my little corner of the internet").first(), + ).toBeVisible(); + await expect( + page.getByAltText("me, my wife, dog, and two cats"), + ).toBeVisible(); + }); +});