refactor(deals): A9 review nits — drop duplicate spec, single Pinia, accurate comment
This commit is contained in:
@@ -133,7 +133,7 @@ async function saveComment() {
|
||||
}
|
||||
}
|
||||
|
||||
// Загрузка при появлении/смене сделки (панель монтируется только при deal != null).
|
||||
// Загрузка при появлении/смене сделки. Компонент смонтирован всегда — тело (<div v-if="deal">) рендерится только при deal != null.
|
||||
watch(
|
||||
() => [props.deal?.id, props.tenantId] as const,
|
||||
() => {
|
||||
|
||||
@@ -12,11 +12,12 @@ const deal: MockDeal = {
|
||||
};
|
||||
|
||||
function mountDrawer(props: Record<string, unknown>) {
|
||||
setActivePinia(createPinia());
|
||||
const pinia = createPinia();
|
||||
setActivePinia(pinia);
|
||||
return mount(DealDetailDrawer, {
|
||||
props: { open: true, deal, ...props },
|
||||
global: {
|
||||
plugins: [vuetify, createPinia()],
|
||||
plugins: [vuetify, pinia],
|
||||
stubs: {
|
||||
DealDetailBody: true,
|
||||
VNavigationDrawer: {
|
||||
|
||||
@@ -107,12 +107,6 @@ describe('DealDetailBody ↔ GET /api/deals/{id} integration', () => {
|
||||
expect(items).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('без tenantId → getDeal не вызывается (body загружается по deal/tenantId)', async () => {
|
||||
factory({});
|
||||
await flushPromises();
|
||||
expect(dealsApi.getDeal).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('saveComment вызывает updateDeal + toast success + reload events', async () => {
|
||||
const apiResponse: GetDealResponse = {
|
||||
deal: {
|
||||
|
||||
Reference in New Issue
Block a user