Skip to content

Commit

Permalink
test: ensuring progress is displayed when loading is true
Browse files Browse the repository at this point in the history
  • Loading branch information
axel7083 committed Jan 17, 2024
1 parent 73e5c01 commit 2014298
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions packages/frontend/src/lib/NavPage.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import '@testing-library/jest-dom/vitest';
import { test, expect } from 'vitest';
import { fireEvent, render, screen, within } from '@testing-library/svelte';

Check failure on line 3 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / windows-2022

'fireEvent' is defined but never used

Check failure on line 3 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / windows-2022

'within' is defined but never used

Check failure on line 3 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / ubuntu-22.04

'fireEvent' is defined but never used

Check failure on line 3 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / ubuntu-22.04

'within' is defined but never used

Check failure on line 3 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / macos-12

'fireEvent' is defined but never used

Check failure on line 3 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / macos-12

'within' is defined but never used
import NavPage from '/@/lib/NavPage.svelte';

test('NavPage should have linear progress', async () => {
// render the component
render(NavPage, {loading: true, title: 'dummy'});

const content = await screen.findByLabelText('content');
expect(content).toBeDefined();
expect(content.firstChild?.nodeName).toBe('PROGRESS');
});

test('NavPage should not have linear progress', async () => {
// render the component
render(NavPage, {title: 'dummy'},);

Check warning on line 17 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / windows-2022

Unexpected trailing comma

Check warning on line 17 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / ubuntu-22.04

Unexpected trailing comma

Check warning on line 17 in packages/frontend/src/lib/NavPage.spec.ts

View workflow job for this annotation

GitHub Actions / linter, formatters and unit tests / macos-12

Unexpected trailing comma

const content = await screen.findByLabelText('content');
expect(content).toBeDefined();
expect(content.firstChild).toBeNull(); // no slot content provided
});

0 comments on commit 2014298

Please sign in to comment.