diff --git a/packages/frontend/src/lib/NavPage.spec.ts b/packages/frontend/src/lib/NavPage.spec.ts new file mode 100644 index 000000000..dce409e37 --- /dev/null +++ b/packages/frontend/src/lib/NavPage.spec.ts @@ -0,0 +1,22 @@ +import '@testing-library/jest-dom/vitest'; +import { test, expect } from 'vitest'; +import { fireEvent, render, screen, within } from '@testing-library/svelte'; +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'},); + + const content = await screen.findByLabelText('content'); + expect(content).toBeDefined(); + expect(content.firstChild).toBeNull(); // no slot content provided +});