feat(auth): build login page with LoginForm, brand panel, and title
Replaces placeholder with full login page: brand panel left, LoginForm right, svelte:head title, signup link, no-nav-chrome. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
44
frontend/src/routes/(public)/login/page.test.ts
Normal file
44
frontend/src/routes/(public)/login/page.test.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
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/login') })
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock('$app/forms', () => ({
|
||||
enhance: () => ({ destroy: () => {} })
|
||||
}));
|
||||
|
||||
describe('login page', () => {
|
||||
it('renders the login form', () => {
|
||||
render(Page);
|
||||
expect(screen.getByText('Willkommen zurück')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders the brand panel', () => {
|
||||
render(Page);
|
||||
expect(screen.getByText('Mealprep')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('sets the page title', () => {
|
||||
render(Page);
|
||||
expect(document.title).toBe('Anmelden — Mealprep');
|
||||
});
|
||||
|
||||
it('does not render any navigation chrome', () => {
|
||||
render(Page);
|
||||
expect(screen.queryByRole('navigation')).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('Planer')).not.toBeInTheDocument();
|
||||
expect(screen.queryByText('Rezepte')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('renders a link to the signup page', () => {
|
||||
render(Page);
|
||||
const link = screen.getByRole('link', { name: /registrieren/i });
|
||||
expect(link).toHaveAttribute('href', '/signup');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user