16 lines
714 B
TypeScript
16 lines
714 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|||
|
|
import { CLIENT_PATHS, CLIENT_ROUTES, clientRoute } from './client-routes';
|
||
|
|
|
||
|
|
describe('rutas de cliente', () => {
|
||
|
|
it('una pantalla de cliente cuelga de su ruta de menú, con permiso y en diferido', () => {
|
||
|
|
const r = clientRoute('/inventario/ejemplo', 'Ejemplo', async () => class {});
|
||
|
|
expect(r.path).toBe('inventario/ejemplo');
|
||
|
|
expect(r.data).toEqual({ path: '/inventario/ejemplo', title: 'Ejemplo' });
|
||
|
|
expect(r.canActivate).toHaveLength(1);
|
||
|
|
expect(r.loadComponent).toBeTypeOf('function');
|
||
|
|
});
|
||
|
|
|
||
|
|
it('las rutas de cliente salen de la lista de rutas', () => {
|
||
|
|
expect(CLIENT_PATHS).toEqual(CLIENT_ROUTES.map((r) => `/${r.path}`));
|
||
|
|
});
|
||
|
|
});
|