Skip to content

Commit 0f2aed7

Browse files
committed
03/02: update solution test
1 parent 0d9a980 commit 0f2aed7

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

exercises/03.guides/02.solution.test-data/tests/e2e/notes-list.test.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ test('displays all user notes', async ({ navigate, authenticate, page }) => {
77
ownerId: user.id,
88
notes: [
99
{
10-
title: 'First note',
10+
title: 'First Note',
1111
content: 'Hello world',
1212
},
1313
{
14-
title: 'Second note',
15-
content: 'Hello world',
14+
title: 'Second Note',
15+
content: 'Goodbye cosmos',
1616
},
1717
],
1818
})
@@ -24,5 +24,17 @@ test('displays all user notes', async ({ navigate, authenticate, page }) => {
2424
.getByRole('listitem')
2525
.getByRole('link')
2626

27-
await expect(notes).toHaveText(['First note', 'Second note'])
27+
await expect(notes).toHaveText(['First Note', 'Second Note'])
28+
29+
await notes.getByText('First Note').click()
30+
await expect(page.getByRole('heading', { name: 'First Note' })).toBeVisible()
31+
await expect(
32+
page.getByLabel('First Note').getByText('Hello world'),
33+
).toBeVisible()
34+
35+
await notes.getByText('Second Note').click()
36+
await expect(page.getByRole('heading', { name: 'Second Note' })).toBeVisible()
37+
await expect(
38+
page.getByLabel('Second Note').getByText('Goodbye cosmos'),
39+
).toBeVisible()
2840
})

0 commit comments

Comments
 (0)