22e6bdf8b8
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { describe, it, expect, beforeEach } from 'vitest';
|
|
import { mount, flushPromises } from '@vue/test-utils';
|
|
import { createPinia, setActivePinia } from 'pinia';
|
|
import { createVuetify } from 'vuetify';
|
|
import { createMemoryHistory, createRouter } from 'vue-router';
|
|
import KanbanView from '../../resources/js/views/KanbanView.vue';
|
|
|
|
// KanbanView содержит DealDetailDrawer (VNavigationDrawer) — требует
|
|
// injected layout от v-app, недоступной в Vitest. Stub'им как в KanbanView.spec.ts.
|
|
function setup() {
|
|
setActivePinia(createPinia());
|
|
const router = createRouter({
|
|
history: createMemoryHistory(),
|
|
routes: [{ path: '/', component: KanbanView }],
|
|
});
|
|
router.push('/');
|
|
return mount(KanbanView, {
|
|
global: {
|
|
plugins: [router, createVuetify()],
|
|
stubs: { RouterLink: true, DealDetailDrawer: true, NewDealDialog: true },
|
|
},
|
|
});
|
|
}
|
|
|
|
describe('KanbanView — redesigned', () => {
|
|
beforeEach(() => setActivePinia(createPinia()));
|
|
|
|
it('card containers have ld-hover-lift class', async () => {
|
|
const w = setup();
|
|
await flushPromises();
|
|
expect(w.html()).toMatch(/ld-hover-lift/);
|
|
});
|
|
|
|
it('column headers use ld-label class', async () => {
|
|
const w = setup();
|
|
await flushPromises();
|
|
expect(w.html()).toMatch(/ld-label/);
|
|
});
|
|
});
|