Files
portal/app/tests/Frontend/AdminIncidentsView.spec.ts
T
Дмитрий f65b2ca8d8 phase2(admin-views): AdminBilling/Incidents/System — реальные display-views
- AdminBillingView: 4 stats (MRR, Выручка, Просрочка, Возвраты) + v-data-table 7 колонок (Тенант с ИНН / Тариф / Баланс с error-color / пополнения / списания / MRR / Статус-chip) + поиск
- AdminIncidentsView: 3 stats + 5 фильтров статуса + v-list с incident_id (INC-YYYY-MMDD-NNNN) + severity/status/РКН-pending chips + дедлайн 24ч по 152-ФЗ
- AdminSystemView: read-only warning + поиск + v-list 7 system_settings (webhook_rate_limit, login_max_attempts, retention и т.д.) с type-chip и updated_at
- composables/mockAdmin.ts: AdminBillingTenantRow + AdminIncidentRow + AdminSystemSetting + mock-данные
- Router: /admin/{billing,incidents,system} → реальные views (не placeholder)
- Vitest +13 (179/179 за 11.98с)
- TODO: edit-flow для system_settings + backend /api/admin/* endpoints
- Регресс: lint+type+format OK; build 743ms; story:build 21/28 за 31.5с
- CLAUDE.md v1.42→v1.43, реестр v1.51→v1.52

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

56 lines
2.2 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 { createRouter, createMemoryHistory } from 'vue-router';
import AdminIncidentsView from '../../resources/js/views/admin/AdminIncidentsView.vue';
const mountView = async () => {
const router = createRouter({
history: createMemoryHistory(),
routes: [{ path: '/admin/incidents', component: AdminIncidentsView }],
});
await router.push('/admin/incidents');
await router.isReady();
return mount(AdminIncidentsView, {
global: { plugins: [createVuetify(), router] },
});
};
describe('AdminIncidentsView.vue', () => {
it('монтируется и содержит заголовок «Инциденты»', async () => {
const wrapper = await mountView();
expect(wrapper.text()).toContain('Инциденты');
});
it('содержит 3 stats: Открыто / Расследуется / РКН-уведомлений', async () => {
const wrapper = await mountView();
const text = wrapper.text();
expect(text).toContain('Открыто');
expect(text).toContain('Расследуется');
expect(text).toContain('РКН-уведомлений');
});
it('содержит фильтр-toggle по статусам (5 значений)', async () => {
const wrapper = await mountView();
const text = wrapper.text();
expect(text).toContain('Все');
expect(text).toContain('Открыты');
expect(text).toContain('Решены');
expect(text).toContain('Закрыты');
});
it('показывает PDN-breach с РКН pending chip', async () => {
const wrapper = await mountView();
const text = wrapper.text();
expect(text).toContain('Утечка ПДн');
expect(text).toContain('РКН pending');
});
it('содержит incident_id в формате INC-YYYY-MMDD-NNNN', async () => {
const wrapper = await mountView();
const text = wrapper.text();
expect(text).toContain('INC-2026-0507-0034');
expect(text).toContain('INC-2026-0506-0028');
});
});