Files
portal/app/tests/Frontend/DashboardView.spec.ts
T
Дмитрий 1e233a70c8 phase2(dashboard): AppLayout + DashboardView - default-layout приложения
- AppLayout: v-navigation-drawer (теало-нуар sidebar 240px) + brand-block
  + nav-tree из 8 пунктов в 3 группах (Работа/Финансы/Команда), v-app-bar
  с crumb «Рабочая область → currentPage» + search ⌘K + bell + user-chip.
  Mobile (md<): drawer toggleable.
- DashboardView: page-head «Доброе утро, Иван» + page-meta + range-toggle
  4 опции (Сегодня/7д/30д/Период). KPI-row из 4 cards: 3 outlined (получено
  лидов/конверсия/активные проекты) + 1 hero balance с runway-bar 4/7
  заполненных сегментов teal #32C8A9.
- AppShell упрощён до layout-mapper (route.meta.layout 'app'/'auth').
- Маршрут /dashboard (meta.layout='app') в router + web.php.
- histoire.setup расширен 8 app-stub-маршрутами для AppLayout.
- Vitest +11 тестов: AppLayout 6 (brand+3 группы+8 пунктов+счётчики+crumb),
  DashboardView 5, AppShell.spec.ts переписан под layout-mapper.
- cspell-words.txt: JBM.

Регресс: lint+type-check+format OK; vitest 35/35 за 4.92s; vite build
DashboardView lazy-chunk 14.9KB; story:build 8/8 за 28.97s; Pest 48/48 за 4.88s.

CLAUDE.md v1.20->v1.21, реестр Открытых_вопросов v1.29->v1.30.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 17:21:19 +03:00

48 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, it, expect } from 'vitest';
import { mount } from '@vue/test-utils';
import { createVuetify } from 'vuetify';
import DashboardView from '../../resources/js/views/DashboardView.vue';
describe('DashboardView.vue', () => {
const factory = () =>
mount(DashboardView, {
global: { plugins: [createVuetify()] },
});
it('монтируется и содержит приветствие', () => {
const wrapper = factory();
expect(wrapper.text()).toContain('Доброе утро');
});
it('содержит range-toggle с 4 опциями', () => {
const wrapper = factory();
const text = wrapper.text();
expect(text).toContain('Сегодня');
expect(text).toContain('7 дней');
expect(text).toContain('30 дней');
expect(text).toContain('Период');
});
it('содержит 3 KPI-cards (получено лидов / конверсия / активные проекты)', () => {
const wrapper = factory();
const text = wrapper.text();
expect(text).toContain('Получено лидов');
expect(text).toContain('Конверсия в оплату');
expect(text).toContain('Активные проекты');
});
it('содержит balance-card с suммой и runway', () => {
const wrapper = factory();
const text = wrapper.text();
expect(text).toContain('Баланс');
expect(text).toContain('14 250');
expect(text).toContain('LIVE');
expect(text).toContain('хватит на');
});
it('runway-bar содержит 7 сегментов (по числу runwayMax)', () => {
const wrapper = factory();
expect(wrapper.findAll('.runway-fill')).toHaveLength(7);
});
});