Skip to content

Commit

Permalink
💚 Update e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Bernardstanislas committed May 1, 2023
1 parent 5e6f715 commit 555f539
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/routes/[month]/[day]/[year]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
</script>

<div class="pt-2" data-testid="journal">
<div class="pt-2">
<h2 class="text-xl">
{date.toLocaleDateString(undefined, {
weekday: 'long',
Expand Down
6 changes: 3 additions & 3 deletions tests/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { expect, test } from '@playwright/test';
test('app counts words', async ({ page }) => {
await page.goto('/');
await page.locator('textarea').fill('Yolo croute lol');
await expect(page.getByTestId('words-count')).toHaveText('3 words');
await expect(page.getByTestId('words-count')).toHaveText('3/750 words');
});

test("app stores journal's content", async ({ page }) => {
Expand All @@ -28,7 +28,7 @@ test("app stores journal's content", async ({ page }) => {
await expect(journal).toHaveValue(content);

// Navigate to yersderday's journal
await expect(page.locator('a')).toHaveCount(2);
await page.locator('a').last().click();
await expect(page.locator('a.underline')).toHaveCount(2);
await page.locator('a.underline').last().click();
await expect(page.getByTestId('journal')).toHaveText(content);
});

1 comment on commit 555f539

@vercel
Copy link

@vercel vercel bot commented on 555f539 May 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.