Skip to content

Commit

Permalink
fix e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shannonwells committed Nov 14, 2024
1 parent 9334f51 commit 38d3433
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/GetNotified/GetNotified.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div class="mx-auto w-full p-[36px] md:w-[396px] md:p-0 md:py-[96px]">
{#if !formSuccess}
<h3 class="h3 font-bold">Contact</h3>
<form on:submit|preventDefault={submit} novalidate class="mt-f24 flex flex-col gap-f24">
<form on:submit|preventDefault={submit} novalidate class="mt-f24 flex flex-col gap-f24" data-testid="contact-form">
<Input
label="Name"
name="name"
Expand Down
13 changes: 8 additions & 5 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ test('index page has expected content', async ({ page }) => {
expect(page.getByText('Build at a higher Frequency')).toBeDefined();
});

test('index page has a popout', async ({ page }) => {
test('contact form can be filled out and shows errors', async ({ page }) => {
await page.goto('/');
const popoutButton = page.getByText('Get Notified');
expect(popoutButton).toBeDefined();

await popoutButton.click();
const contactLink = page.locator('[href="/#contact"]').first();
expect(contactLink).toBeDefined();

expect(page.getByText("Interested in Frequency's ecosystem?")).toBeDefined();
const form = await page.getByTestId('contact-form');
expect(form).toBeDefined();
await page.getByText(/Send Message/).click();

expect(page.getByText('Please fill out this field.')).toBeDefined();
});

test('routes sanity check', async ({ page }) => {
Expand Down

0 comments on commit 38d3433

Please sign in to comment.