Files
ForgeBase/Max Avatar/tests/unit/components/LoginView.test.tsx
T
williamandClaude Sonnet 5 ed32c21f24 feat(auth): add LoginCard and wire it into LoginView
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>
2026-10-31 21:49:15 +01:00

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()
})
})