From a8f1ffe356132a9a48e58c0a2f5cb902d6ded63b Mon Sep 17 00:00:00 2001 From: Fedor Date: Sun, 8 Nov 2026 19:50:01 +0300 Subject: [PATCH] Verify the V1 reminder scope and published program entry --- .../program-attention-actions.service.spec.ts | 20 +++++++++++++------ .../program-card.component.spec.ts | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/projects/social_platform/src/app/api/program/facades/detail/program-attention-actions.service.spec.ts b/projects/social_platform/src/app/api/program/facades/detail/program-attention-actions.service.spec.ts index e32de4465..b146e2e26 100644 --- a/projects/social_platform/src/app/api/program/facades/detail/program-attention-actions.service.spec.ts +++ b/projects/social_platform/src/app/api/program/facades/detail/program-attention-actions.service.spec.ts @@ -28,10 +28,15 @@ const preview: ProgramAttentionPreview = { describe("Attention bulk actions", () => { let state: ProgramAnalyticsDrilldownService; const actions = { preview: vi.fn(), send: vi.fn(), export: vi.fn() }; - const repo = { getManagerParticipantsWithoutTeam: vi.fn(), getCaseProjects: vi.fn() }; + const repo = { + getManagerParticipantsWithoutTeam: vi.fn(), + getManagerParticipantsWithoutVisit: vi.fn(), + getCaseProjects: vi.fn(), + }; beforeEach(() => { vi.clearAllMocks(); repo.getManagerParticipantsWithoutTeam.mockReturnValue(of(participantsPage({ count: 51 }))); + repo.getManagerParticipantsWithoutVisit.mockReturnValue(of(participantsPage({ count: 51 }))); actions.preview.mockReturnValue(of(ok(preview))); actions.send.mockReturnValue(of(ok({ createdCount: 1, skippedCount: 0 }))); actions.export.mockReturnValue(of(ok(new Blob(["xlsx"])))); @@ -43,7 +48,7 @@ describe("Attention bulk actions", () => { ], }); state = TestBed.inject(ProgramAnalyticsDrilldownService); - state.openAttention(12, "participants-without-team"); + state.openAttention(12, "participants-without-visit"); }); it("selects all matching pages with exclusions and preserves explicit row selection on pagination", () => { @@ -55,7 +60,7 @@ describe("Attention bulk actions", () => { expect(state.isSelected(124)).toBe(true); expect(state.isSelected(123)).toBe(false); state.previewReminder(); - expect(actions.preview).toHaveBeenCalledWith(12, "participants-without-team", { + expect(actions.preview).toHaveBeenCalledWith(12, "participants-without-visit", { search: "", selection: { mode: "all", ids: [], excludedIds: [123] }, }); @@ -79,7 +84,7 @@ describe("Attention bulk actions", () => { state.sendReminder(); expect(actions.send).toHaveBeenCalledExactlyOnceWith( 12, - "participants-without-team", + "participants-without-visit", "signed-preview", ); expect(state.actionSuccess()).toContain("Напоминания созданы: 1"); @@ -166,13 +171,16 @@ describe("Attention bulk actions", () => { expect(actions.export).toHaveBeenCalled(); }); - it("exports all found without selection and only selected when rows are checked", () => { + it("exports all or selected participants without a team and skips reminders for this list", () => { + state.openAttention(12, "participants-without-team"); state.exportAttention(); expect(actions.export).toHaveBeenLastCalledWith(12, "participants-without-team", { search: "", selection: { mode: "all", ids: [], excludedIds: [] }, }); state.toggleSelection(123); + state.previewReminder(); + expect(actions.preview).not.toHaveBeenCalled(); state.exportAttention(); expect(actions.export).toHaveBeenLastCalledWith(12, "participants-without-team", { search: "", @@ -190,7 +198,7 @@ describe("Attention bulk actions", () => { state.toggleSelection(123); state.previewReminder(); state.close(); - state.openAttention(24, "participants-without-team"); + state.openAttention(24, "participants-without-visit"); pending.next(ok(preview)); expect(state.preview()).toBeNull(); expect(state.selectedCount()).toBe(0); diff --git a/projects/social_platform/src/app/ui/pages/program/main/program-card/program-card.component.spec.ts b/projects/social_platform/src/app/ui/pages/program/main/program-card/program-card.component.spec.ts index d4b839adb..af4fdab87 100644 --- a/projects/social_platform/src/app/ui/pages/program/main/program-card/program-card.component.spec.ts +++ b/projects/social_platform/src/app/ui/pages/program/main/program-card/program-card.component.spec.ts @@ -62,7 +62,7 @@ describe("ProgramCardComponent", () => { expect(element().querySelector(".card__registration")?.textContent).toContain("Регистрация до"); expect(element().textContent).toContain("Опубликована"); expect(element().querySelector("a")?.getAttribute("href")).toBe( - "/office/program/7/management/participants", + "/office/program/7/management/analytics", ); }); it("uses the saved image and keeps the native mobile avatar", () => {