-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathfilesystem-sync.test.ts
More file actions
35 lines (25 loc) · 1.08 KB
/
filesystem-sync.test.ts
File metadata and controls
35 lines (25 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { test, expect } from '@playwright/test';
const BASE_URL = '/tests/filesystem-sync';
test('editor should reflect changes made from webcontainer', async ({ page }) => {
const testCase = 'happy-path';
await page.goto(`${BASE_URL}/${testCase}`);
await expect(page.getByRole('textbox', { name: 'Editor' })).toHaveText('Initial content\n', {
useInnerText: true,
});
await page.getByTestId('write-to-file').click();
await expect(page.getByRole('textbox', { name: 'Editor' })).toHaveText('Something else', {
useInnerText: true,
});
});
test('editor should reflect changes made from webcontainer in file in nested folder', async ({ page }) => {
const testCase = 'happy-path';
await page.goto(`${BASE_URL}/${testCase}`);
await page.getByRole('button', { name: 'baz.txt' }).click();
await expect(page.getByRole('textbox', { name: 'Editor' })).toHaveText('Baz', {
useInnerText: true,
});
await page.getByTestId('write-to-file-in-subfolder').click();
await expect(page.getByRole('textbox', { name: 'Editor' })).toHaveText('Foo', {
useInnerText: true,
});
});