Skip to content

Commit

Permalink
Correctly await ContentsHelper calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthomas23 committed Nov 8, 2024
1 parent 788ec5d commit ce54d8a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui-tests/tests/fs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ test.describe('Filesystem', () => {
await inputLine(page, 'cp months.txt other.txt');
await page.filebrowser.refresh();

expect(page.contents.fileExists('months.txt')).toBeTruthy();
expect(page.contents.fileExists('other.txt')).toBeTruthy();
expect(await page.contents.fileExists('months.txt')).toBeTruthy();
expect(await page.contents.fileExists('other.txt')).toBeTruthy();

const other = await page.contents.getContentMetadata('other.txt');
expect(other?.content).toEqual(MONTHS_TXT);
Expand All @@ -61,14 +61,14 @@ test.describe('Filesystem', () => {
await inputLine(page, 'rm fact.lua');
await page.filebrowser.refresh();

expect(page.contents.fileExists('fact.lua')).toBeFalsy();
expect(await page.contents.fileExists('fact.lua')).toBeFalsy();

Check failure on line 64 in ui-tests/tests/fs.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

tests/fs.spec.ts:60:7 › Filesystem › should support rm

1) tests/fs.spec.ts:60:7 › Filesystem › should support rm ──────────────────────────────────────── Error: expect(received).toBeFalsy() Received: true 62 | await page.filebrowser.refresh(); 63 | > 64 | expect(await page.contents.fileExists('fact.lua')).toBeFalsy(); | ^ 65 | }); 66 | 67 | test('should support touch', async ({ page }) => { at /home/runner/work/terminal/terminal/ui-tests/tests/fs.spec.ts:64:56

Check failure on line 64 in ui-tests/tests/fs.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

tests/fs.spec.ts:60:7 › Filesystem › should support rm

1) tests/fs.spec.ts:60:7 › Filesystem › should support rm ──────────────────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeFalsy() Received: true 62 | await page.filebrowser.refresh(); 63 | > 64 | expect(await page.contents.fileExists('fact.lua')).toBeFalsy(); | ^ 65 | }); 66 | 67 | test('should support touch', async ({ page }) => { at /home/runner/work/terminal/terminal/ui-tests/tests/fs.spec.ts:64:56

Check failure on line 64 in ui-tests/tests/fs.spec.ts

View workflow job for this annotation

GitHub Actions / Integration tests

tests/fs.spec.ts:60:7 › Filesystem › should support rm

1) tests/fs.spec.ts:60:7 › Filesystem › should support rm ──────────────────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toBeFalsy() Received: true 62 | await page.filebrowser.refresh(); 63 | > 64 | expect(await page.contents.fileExists('fact.lua')).toBeFalsy(); | ^ 65 | }); 66 | 67 | test('should support touch', async ({ page }) => { at /home/runner/work/terminal/terminal/ui-tests/tests/fs.spec.ts:64:56
});

test('should support touch', async ({ page }) => {
await inputLine(page, 'touch touched.txt');
await page.filebrowser.refresh();

expect(page.contents.fileExists('touched.txt')).toBeTruthy();
expect(await page.contents.fileExists('touched.txt')).toBeTruthy();

const other = await page.contents.getContentMetadata('touched.txt');
expect(other?.content).toEqual('');
Expand Down

0 comments on commit ce54d8a

Please sign in to comment.