diff --git a/solution/ui/e2e/cypress/e2e/policy-repository.spec.cy.js b/solution/ui/e2e/cypress/e2e/policy-repository.spec.cy.js index 8a286ab7c2..f56b01bf24 100644 --- a/solution/ui/e2e/cypress/e2e/policy-repository.spec.cy.js +++ b/solution/ui/e2e/cypress/e2e/policy-repository.spec.cy.js @@ -492,6 +492,60 @@ describe("Policy Repository", () => { cy.url().should("include", "/resources"); }); + it("should have the correct labels for public and internal documents", () => { + cy.intercept("**/v3/content-search/?q=test**", { + fixture: "policy-docs.json", + }).as("queriedFiles"); + cy.viewport("macbook-15"); + cy.eregsLogin({ + username, + password, + landingPage: "/policy-repository/", + }); + cy.visit("/policy-repository/"); + cy.get("input#main-content") + .should("be.visible") + .type("test", { force: true }); + cy.get(".search-field .v-input__icon--append button").click({ + force: true, + }); + cy.wait("@queriedFiles").then((interception) => { + expect(interception.response.statusCode).to.eq(200); + }); + + // Public doc + cy.get(".category-labels") + .eq(0) + .find(".doc-type__label") + .should("include.text", " Public ") + .find("i") + .should("have.class", "fa-users"); + cy.get(".category-labels") + .eq(0) + .find(".category-label") + .should("include.text", " Subregulatory Guidance "); + cy.get(".category-labels") + .eq(0) + .find(".subcategory-label") + .should("include.text", "CMCS Informational Bulletin (CIB)"); + + // Internal doc + cy.get(".category-labels") + .eq(1) + .find(".doc-type__label") + .should("include.text", " Internal ") + .find("i") + .should("have.class", "fa-key"); + cy.get(".category-labels") + .eq(1) + .find(".category-label") + .should("include.text", "TestCat"); + cy.get(".category-labels") + .eq(1) + .find(".subcategory-label") + .should("include.text", "TestSubCat"); + }); + it("returns you to the custom eua login page when you log out", () => { cy.viewport("macbook-15"); cy.eregsLogin({ username, password, landingPage: "/policy-repository/" }); @@ -545,7 +599,7 @@ describe("Policy Repository Search", () => { }); }); - it("should have the correct public/internal label", () => { + it("should have the correct labels for public and internal documents", () => { cy.intercept("**/v3/content-search/?q=test**", { fixture: "policy-docs.json", }).as("queriedFiles"); @@ -565,15 +619,37 @@ describe("Policy Repository Search", () => { cy.wait("@queriedFiles").then((interception) => { expect(interception.response.statusCode).to.eq(200); }); - cy.get(".doc-type__label") + + // Public doc + cy.get(".category-labels") .eq(0) + .find(".doc-type__label") .should("include.text", " Public ") .find("i") .should("have.class", "fa-users"); - cy.get(".doc-type__label") + cy.get(".category-labels") + .eq(0) + .find(".category-label") + .should("include.text", " Subregulatory Guidance "); + cy.get(".category-labels") + .eq(0) + .find(".subcategory-label") + .should("include.text", "CMCS Informational Bulletin (CIB)"); + + // Internal doc + cy.get(".category-labels") .eq(1) + .find(".doc-type__label") .should("include.text", " Internal ") .find("i") .should("have.class", "fa-key"); + cy.get(".category-labels") + .eq(1) + .find(".category-label") + .should("include.text", "TestCat"); + cy.get(".category-labels") + .eq(1) + .find(".subcategory-label") + .should("include.text", "TestSubCat"); }); }); diff --git a/solution/ui/e2e/cypress/fixtures/policy-docs.json b/solution/ui/e2e/cypress/fixtures/policy-docs.json index 0f39009768..eb64a46a43 100644 --- a/solution/ui/e2e/cypress/fixtures/policy-docs.json +++ b/solution/ui/e2e/cypress/fixtures/policy-docs.json @@ -141,7 +141,22 @@ "abbreviation": null } ], - "category": {}, + "category": { + "id": 2, + "name": "TestSubCat", + "description": "", + "order": 0, + "show_if_empty": false, + "type": "repositorysubcategory", + "parent": { + "id": 1, + "name": "TestCat", + "description": "This is a test category. It may have child subcategories.", + "order": 0, + "show_if_empty": false, + "type": "" + } + }, "url": "d89af093-8975-4bcb-a747-abe346ebb274", "document_name_headline": "[Mock] Cypress Fixture", "summary_headline": "This is the summary. Rubber baby buggy bumper" diff --git a/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.vue b/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.vue index 926523949f..c61615ea56 100644 --- a/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.vue +++ b/solution/ui/regulations/eregs-vite/src/components/policy-repository/PolicyResults.vue @@ -166,24 +166,33 @@ const resultLinkClasses = (doc) => ({ /> diff --git a/solution/ui/regulations/test/unit-test/__snapshots__/SupplementalContent.test.js.snap b/solution/ui/regulations/test/unit-test/__snapshots__/SupplementalContent.test.js.snap index cd116d2323..9a5688fc05 100644 --- a/solution/ui/regulations/test/unit-test/__snapshots__/SupplementalContent.test.js.snap +++ b/solution/ui/regulations/test/unit-test/__snapshots__/SupplementalContent.test.js.snap @@ -16,7 +16,6 @@ exports[`Supplemental Content > Checks to see if the snap shot matches 1`] = ` > Subpart A Resources -
@@ -5902,7 +5901,6 @@ exports[`Supplemental Content > Checks to see if the snap shot matches 1`] = ` > Subpart A Resources -