From c48d97f2a7ca7b1f03652751976d00e35078086e Mon Sep 17 00:00:00 2001 From: Caleb Burke Date: Fri, 4 Sep 2026 14:31:43 -0700 Subject: [PATCH] :bug: Show ISA optional additional-details sections when viewing an agreement. The optional sections (detail level, formats, credit lines, expiration and breach actions, and the compelled-disclosure notes) were editable but never rendered on the agreement view page, so users could not see the complete agreement. Adds a read-only Additional Details card mirroring the edit form. See https://yg-hpw.atlassian.net/browse/TK-93 --- ...nSharingAgreementAdditionalDetailsCard.vue | 258 ++++++++++++++++++ .../InformationSharingAgreementPage.vue | 15 + ...ringAgreementAdditionalDetailsCard.test.ts | 76 ++++++ 3 files changed, 349 insertions(+) create mode 100644 web/src/components/information-sharing-agreements/InformationSharingAgreementAdditionalDetailsCard.vue create mode 100644 web/tests/components/information-sharing-agreements/InformationSharingAgreementAdditionalDetailsCard.test.ts diff --git a/web/src/components/information-sharing-agreements/InformationSharingAgreementAdditionalDetailsCard.vue b/web/src/components/information-sharing-agreements/InformationSharingAgreementAdditionalDetailsCard.vue new file mode 100644 index 00000000..c5e9fdcf --- /dev/null +++ b/web/src/components/information-sharing-agreements/InformationSharingAgreementAdditionalDetailsCard.vue @@ -0,0 +1,258 @@ + + + + + diff --git a/web/src/pages/information-sharing-agreements/InformationSharingAgreementPage.vue b/web/src/pages/information-sharing-agreements/InformationSharingAgreementPage.vue index df45a927..8bbb9e63 100644 --- a/web/src/pages/information-sharing-agreements/InformationSharingAgreementPage.vue +++ b/web/src/pages/information-sharing-agreements/InformationSharingAgreementPage.vue @@ -50,6 +50,20 @@ :authorized-application="informationSharingAgreement.authorizedApplication" /> + +
["$props"] + > = {} +) { + return mount(InformationSharingAgreementAdditionalDetailsCard, { + props: { + detailLevel: null, + detailNotes: null, + formats: null, + creditLines: null, + creditNotes: null, + expirationActions: null, + expirationNotes: null, + breachActions: null, + breachNotes: null, + disclosureNotes: null, + ...props, + }, + global: { + plugins: [mockVuetify(), i18n], + }, + }) +} + +describe("InformationSharingAgreementAdditionalDetailsCard.vue", () => { + it("renders the translated labels for selected comma-joined options", () => { + const wrapper = mountCard({ + detailLevel: "original,summary", + formats: "word_documents,photos", + creditLines: "external_organization", + }) + + const text = wrapper.text() + expect(text).toContain("Original: No alterations or summary") + expect(text).toContain("Summary: Notes, high-level summary, redacted portions") + expect(text).toContain("Word documents") + expect(text).toContain("Photos") + expect(text).toContain("Yukon First Nation or Indigenous Government") + }) + + it("renders the free-text notes for completed sections", () => { + const wrapper = mountCard({ + detailNotes: "Review required before summarizing.", + disclosureNotes: "Notify the community before any compelled disclosure.", + }) + + const text = wrapper.text() + expect(text).toContain("Review required before summarizing.") + expect(text).toContain("Notify the community before any compelled disclosure.") + }) + + it("shows a placeholder for every optional section when nothing is filled in", () => { + const wrapper = mountCard() + + const placeholders = wrapper.text().match(/Not specified/g) ?? [] + // Sections 2, 3, 7, 8, 9 and 10 each fall back to the placeholder. + expect(placeholders).toHaveLength(6) + }) + + it("ignores values that are not valid options", () => { + const wrapper = mountCard({ formats: "word_documents,not_a_real_format" }) + + const text = wrapper.text() + expect(text).toContain("Word documents") + expect(text).not.toContain("not_a_real_format") + }) +})