Files
portal/app/tests/Frontend/AppBottomNav.spec.ts
T

28 lines
1.3 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 AppBottomNav from '../../resources/js/components/layout/AppBottomNav.vue';
const router = createRouter({
history: createMemoryHistory(),
routes: [
{ path: '/autopodbor', component: { template: '<div/>' } },
{ path: '/projects', component: { template: '<div/>' } },
{ path: '/deals', component: { template: '<div/>' } },
{ path: '/billing', component: { template: '<div/>' } },
{ path: '/kanban', component: { template: '<div/>' } },
],
});
describe('AppBottomNav', () => {
it('рендерит ровно 5 вкладок Поле/Проекты/Сделки/Биллинг/Канбан по порядку', async () => {
const vuetify = createVuetify();
router.push('/deals');
await router.isReady();
const wrapper = mount(AppBottomNav, { global: { plugins: [vuetify, router] } });
const labels = wrapper.findAll('[data-testid="bottomnav-item"]').map((n) => n.text());
expect(labels).toEqual(['Поле', 'Проекты', 'Сделки', 'Биллинг', 'Канбан']);
});
});