869590a1b2
Этап 1 Task 14. /sales/prospects (менеджер), /sales/prospects/board (начальник, salesBossOnly). Пункты «Потенциальные клиенты» и «Воронка отдела». Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
20 lines
711 B
TypeScript
20 lines
711 B
TypeScript
import { describe, expect, it, vi } from 'vitest';
|
|
|
|
// Мокаем api/auth — как в router.spec — чтобы beforeEach guard не ходил в сеть.
|
|
vi.mock('../../resources/js/api/auth', () => ({
|
|
me: vi.fn(() => Promise.reject(new Error('not authenticated'))),
|
|
login: vi.fn(),
|
|
register: vi.fn(),
|
|
logout: vi.fn(),
|
|
}));
|
|
|
|
import { router } from '../../resources/js/router';
|
|
|
|
describe('маршруты воронки', () => {
|
|
it('есть /sales/prospects и /sales/prospects/board', () => {
|
|
const paths = router.getRoutes().map((r) => r.path);
|
|
expect(paths).toContain('/sales/prospects');
|
|
expect(paths).toContain('/sales/prospects/board');
|
|
});
|
|
});
|