Files
portal/app/tests/Frontend/ProjectCardRedesign.spec.ts
T
Дмитрий 3bbd7787d8 feat(projects-ui): replace archive with delete, drop archived filter
- Remove archived_at from Project interface; rename store.archive → store.del
- BulkActionsBar: archive button → delete (testid, icon, confirm text)
- ProjectCard: archive menu item → delete (emit + icon)
- ProjectDetailsDrawer: confirm text + store.del call
- ProjectsView: @delete binding, remove 'Архивные' status filter entry
- vuetify.ts: add mdi-delete → Trash2 mapping
- All specs/stories updated: archived_at removed, archive → del renamed
- New test: del() calls DELETE /api/projects/{id}

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 08:37:26 +03:00

34 lines
1.1 KiB
TypeScript

import { describe, it, expect } from 'vitest';
import { mount } from '@vue/test-utils';
import { createVuetify } from 'vuetify';
import ProjectCard from '../../resources/js/components/projects/ProjectCard.vue';
const sample = {
id: 1,
name: 'Окна СПб',
signal_type: 'site' as const,
signal_identifier: 'okna.ru',
is_active: true,
daily_limit_target: 50,
delivered_today: 12,
sync_status: 'ok' as const,
};
describe('ProjectCard — redesigned', () => {
it('root has ld-hover-lift class', () => {
const w = mount(ProjectCard, {
props: { project: sample, selected: false },
global: { plugins: [createVuetify()], stubs: { RouterLink: true } },
});
expect(w.classes()).toContain('ld-hover-lift');
});
it('numeric counter uses ld-mono class', () => {
const w = mount(ProjectCard, {
props: { project: sample, selected: false },
global: { plugins: [createVuetify()], stubs: { RouterLink: true } },
});
expect(w.html()).toMatch(/ld-mono/);
});
});