Skip to content

Commit 627c989

Browse files
committed
chore: add test for file in nested folder
1 parent a7eb0d3 commit 627c989

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Baz

e2e/src/content/tutorial/tests/filesystem-sync/happy-path/content.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ import { ButtonWriteToFile } from '@components/ButtonWriteToFile';
99
# Happy path filesystem test
1010

1111
<ButtonWriteToFile client:load filePath="/bar.txt" newContent='Something else' useWebcontainer />
12+
<ButtonWriteToFile client:load filePath="/a/b/baz.txt" newContent='Foo' useWebcontainer testId='write-to-file-in-subfolder' />

e2e/test/filesystem-sync.test.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { test, expect } from '@playwright/test';
22

33
const BASE_URL = '/tests/filesystem-sync';
44

5-
test('editor should reflect changes made in webcontainer', async ({ page }) => {
5+
test('editor should reflect changes made from webcontainer', async ({ page }) => {
66
const testCase = 'happy-path';
77
await page.goto(`${BASE_URL}/${testCase}`);
88

@@ -16,3 +16,20 @@ test('editor should reflect changes made in webcontainer', async ({ page }) => {
1616
useInnerText: true,
1717
});
1818
});
19+
20+
test('editor should reflect changes made from webcontainer in file in nested folder', async ({ page }) => {
21+
const testCase = 'happy-path';
22+
await page.goto(`${BASE_URL}/${testCase}`);
23+
24+
await page.getByRole('button', { name: 'baz.txt' }).click();
25+
26+
await expect(page.getByRole('textbox', { name: 'Editor' })).toHaveText('Baz', {
27+
useInnerText: true,
28+
});
29+
30+
await page.getByTestId('write-to-file-in-subfolder').click();
31+
32+
await expect(page.getByRole('textbox', { name: 'Editor' })).toHaveText('Foo', {
33+
useInnerText: true,
34+
});
35+
});

0 commit comments

Comments
 (0)