feat(register): add register page with routing and form implementation

This commit is contained in:
2026-07-02 15:57:54 -03:00
parent 5365811a50
commit 57f58c92be
11 changed files with 168 additions and 6 deletions

View File

@@ -106,6 +106,35 @@ describe('app routes', () => {
expect(compiled.textContent).toContain('Componentes reutilizables');
});
it('loads the login page at /login and shows the create account CTA', async () => {
const { fixture, router } = await renderAppAt('/login');
const compiled = fixture.nativeElement as HTMLElement;
expect(router.url).toBe('/login');
expect(compiled.querySelector('app-login-page')).not.toBeNull();
expect(compiled.textContent).toContain('Iniciar sesión');
expect(compiled.textContent).toContain('Crear cuenta');
});
it('loads the register page at /register and renders the shared auth fields', async () => {
const { fixture, router } = await renderAppAt('/register');
const compiled = fixture.nativeElement as HTMLElement;
const placeholders = Array.from(compiled.querySelectorAll('input')).map((input) =>
input.getAttribute('placeholder')
);
expect(router.url).toBe('/register');
expect(compiled.querySelector('app-register-page')).not.toBeNull();
expect(compiled.textContent).toContain('CREAR CUENTA');
expect(compiled.textContent).toContain('Volver');
expect(placeholders).toEqual([
'Nombre y Apellido',
'Email',
'Contraseña',
'Repetir Contraseña'
]);
});
it('renders the tenant not found screen for any route when the tenant is missing', async () => {
const { fixture } = await renderAppAt(
'/componentes-test/reutilizables',