Drop alice/bob password prefill from the login page, add a regression test, and improve bulk-toolbar and disambiguation accessible names. Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
889 B
JavaScript
29 lines
889 B
JavaScript
// @vitest-environment jsdom
|
|
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
import { cleanup, render, screen } from '@testing-library/react';
|
|
|
|
import Login from '../../pages/login.js';
|
|
|
|
vi.mock('next/router', () => ({
|
|
useRouter: () => ({ push: vi.fn() }),
|
|
}));
|
|
|
|
vi.mock('../../components/AuthLayout', () => ({
|
|
default: ({ children }) => <div>{children}</div>,
|
|
}));
|
|
|
|
vi.mock('../../components/AnimatedFireLogo', () => ({
|
|
default: () => <div aria-hidden="true">logo</div>,
|
|
}));
|
|
|
|
describe('Login page', () => {
|
|
afterEach(() => cleanup());
|
|
|
|
it('renders the sign-in CTA without dev quick-login credentials', () => {
|
|
render(<Login />);
|
|
|
|
expect(screen.getByRole('button', { name: /sign in to deck hearth/i })).toBeTruthy();
|
|
expect(screen.queryByText(/quick login/i)).toBeNull();
|
|
expect(document.body.textContent).not.toMatch(/alice123|bob123/);
|
|
});
|
|
});
|