test(auth): add no-nav-chrome regression test for signup page
Verifies signup page renders form and brand panel but no navigation elements (tabs, sidebar, links to app routes). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
33
frontend/src/routes/(public)/signup/page.test.ts
Normal file
33
frontend/src/routes/(public)/signup/page.test.ts
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
import { describe, it, expect, vi } from 'vitest';
|
||||||
|
import { render, screen } from '@testing-library/svelte';
|
||||||
|
import Page from './+page.svelte';
|
||||||
|
|
||||||
|
vi.mock('$app/stores', async () => {
|
||||||
|
const { readable } = await import('svelte/store');
|
||||||
|
return {
|
||||||
|
page: readable({ url: new URL('http://localhost/signup') })
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('signup page', () => {
|
||||||
|
it('renders the signup form', () => {
|
||||||
|
render(Page);
|
||||||
|
expect(screen.getByText('Konto erstellen')).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('renders the brand panel', () => {
|
||||||
|
render(Page);
|
||||||
|
expect(screen.getByText('Mealprep')).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not render any navigation chrome', () => {
|
||||||
|
render(Page);
|
||||||
|
// No nav element should exist
|
||||||
|
expect(screen.queryByRole('navigation')).not.toBeInTheDocument();
|
||||||
|
// No app shell nav links
|
||||||
|
expect(screen.queryByText('Planer')).not.toBeInTheDocument();
|
||||||
|
expect(screen.queryByText('Rezepte')).not.toBeInTheDocument();
|
||||||
|
expect(screen.queryByText('Einkauf')).not.toBeInTheDocument();
|
||||||
|
expect(screen.queryByText('Einstellungen')).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user