Files
portal/app/tests/Frontend/AppShell.spec.ts
T
Дмитрий 952373fce5 phase2(trigger): Vue 3 + Vuetify 3 + ESLint+Prettier+Vue + vue-tsc + Vitest
Триггер фазы 2 выполнен — первый коммит в app/resources/js/. Активирует
5 из 6 инструментов фазы 2 (CLAUDE.md §3.3) — без Histoire (отдельно).

Tailwind удалён (правило CLAUDE.md §5 п.2).

Стек:
  - vue@3.5, vuetify@3.12, @vitejs/plugin-vue@6 (для Vite 8 совместимости —
    @vitejs/plugin-vue@5 поддерживает только Vite 5/6), vite-plugin-vuetify@2
    (auto-import), sass-embedded
  - eslint@10 (flat-config), eslint-plugin-vue@10,
    @vue/eslint-config-typescript@14, eslint-config-prettier, prettier@3.8
  - typescript@6, vue-tsc@3.2
  - vitest@4.1, @vue/test-utils, jsdom, @vitest/coverage-v8

Конфиги:
  - app/vite.config.js — vue + vuetify auto-import
  - app/vitest.config.ts — jsdom + setup file для ResizeObserver/
    IntersectionObserver/matchMedia/CSS.supports stubs (без них Vuetify
    падает в JSDOM)
  - app/eslint.config.js — flat-config
  - app/.prettierrc.json, app/tsconfig.json

Frontend-структура:
  - resources/js/app.ts — точка входа
  - resources/js/plugins/vuetify.ts — палитра Forest (Teal/ivory/теало-нуар
    из BRANDBOOK_v2 §3)
  - resources/js/components/AppShell.vue — первый компонент: v-app +
    v-app-bar + v-card
  - resources/css/app.css — Inter (UI, opsz axis), JetBrains Mono
    (.numeric, tnum)
  - resources/views/welcome.blade.php — упрощён под Vue mount

Smoke-тесты Vitest 3/3 за 2.8 сек:
  - монтируется без ошибок
  - содержит «Лидерра.»
  - рендерит chip с фазой 2

Build: 158 модулей за 386 ms (184 KB JS / 295 KB CSS gzipped).

npm-scripts: lint:vue, format, format:check, type-check, test:vue.
lefthook job #8 (ESLint на staged .ts/.vue) добавлен в pre-commit.
Полный type-check (vue-tsc) и Vitest — отдельно вручную (медленно для
pre-commit: ~3 сек на каждый).

CLAUDE.md v1.16 → v1.17 (фаза 1 → фаза 2 в §6).
Реестр Открытые_вопросы v1.25 → v1.26.

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

32 lines
1.1 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 AppShell from '../../resources/js/components/AppShell.vue';
// Smoke-тесты AppShell.vue: монтируется с Vuetify, рендерит брендовое имя
// и chip с фазой. Полная палитра проверяется в Histoire (отдельный stub).
describe('AppShell.vue', () => {
const factory = () =>
mount(AppShell, {
global: {
plugins: [createVuetify()],
},
});
it('монтируется без ошибок', () => {
const wrapper = factory();
expect(wrapper.exists()).toBe(true);
});
it('содержит брендовое имя «Лидерра.»', () => {
const wrapper = factory();
expect(wrapper.text()).toContain('Лидерра.');
});
it('рендерит chip с фазой 2', () => {
const wrapper = factory();
expect(wrapper.text()).toContain('phase 2');
});
});