f65b2ca8d8
- 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>
45 lines
1.8 KiB
TypeScript
45 lines
1.8 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { mount } from '@vue/test-utils';
|
|
import { createVuetify } from 'vuetify';
|
|
import { createRouter, createMemoryHistory } from 'vue-router';
|
|
import AdminBillingView from '../../resources/js/views/admin/AdminBillingView.vue';
|
|
|
|
const mountView = async () => {
|
|
const router = createRouter({
|
|
history: createMemoryHistory(),
|
|
routes: [{ path: '/admin/billing', component: AdminBillingView }],
|
|
});
|
|
await router.push('/admin/billing');
|
|
await router.isReady();
|
|
return mount(AdminBillingView, {
|
|
global: { plugins: [createVuetify(), router] },
|
|
});
|
|
};
|
|
|
|
describe('AdminBillingView.vue', () => {
|
|
it('монтируется и содержит заголовок «Биллинг»', async () => {
|
|
const wrapper = await mountView();
|
|
expect(wrapper.text()).toContain('Биллинг');
|
|
});
|
|
|
|
it('содержит 4 stats: MRR / Выручка / Просрочка / Возвраты', async () => {
|
|
const wrapper = await mountView();
|
|
const text = wrapper.text();
|
|
expect(text).toContain('MRR');
|
|
expect(text).toContain('Выручка за месяц');
|
|
expect(text).toContain('Просрочка');
|
|
expect(text).toContain('Возвраты за 30 дн');
|
|
});
|
|
|
|
it('содержит таблицу тенантов с tariff/balance/MRR/status', async () => {
|
|
const wrapper = await mountView();
|
|
const text = wrapper.text();
|
|
expect(text).toContain('Окна Москва');
|
|
expect(text).toContain('BigCorp');
|
|
expect(text).toContain('Команда');
|
|
expect(text).toContain('Активен');
|
|
expect(text).toContain('Просрочка');
|
|
expect(text).toContain('Заблокирован');
|
|
});
|
|
});
|