LoginCard implements the spec from docs/Max_Composants_Frontend.md: inline per-field validation (email format, non-empty password), a show/hide password toggle, and idle/loading/error/success states. Uses the Lucide `Bot` icon instead of the doc's literal emoji avatar, since that contradicts the same doc's and Max_Design_System.md's "no emoji icons" rule. LoginView becomes a thin wrapper around LoginCard - the login window's close-on-success and listening-reactivation behavior already happen server-side in index.ts's auth-login handler, so nothing else is needed here. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
15 lines
499 B
TypeScript
15 lines
499 B
TypeScript
import { describe, it, expect, beforeEach, vi } from 'vitest'
|
|
import { render, screen } from '@testing-library/react'
|
|
import LoginView from '../../../src/renderer/src/components/LoginView'
|
|
|
|
beforeEach(() => {
|
|
;(window as unknown as { api: Record<string, unknown> }).api = { login: vi.fn() }
|
|
})
|
|
|
|
describe('<LoginView />', () => {
|
|
it('should render the LoginCard form', () => {
|
|
render(<LoginView />)
|
|
expect(screen.getByRole('button', { name: 'Se connecter' })).toBeInTheDocument()
|
|
})
|
|
})
|