diff --git a/frontend/test/metabase/scenarios/permissions/reproductions/19603-archived-sub-collection-shows-up-in-permissions.cy.spec.js b/frontend/test/metabase/scenarios/permissions/reproductions/19603-archived-sub-collection-shows-up-in-permissions.cy.spec.js new file mode 100644 index 0000000000000000000000000000000000000000..b51821640ae26335ff19c05e964d38dbe0c42012 --- /dev/null +++ b/frontend/test/metabase/scenarios/permissions/reproductions/19603-archived-sub-collection-shows-up-in-permissions.cy.spec.js @@ -0,0 +1,22 @@ +import { restore } from "__support__/e2e/cypress"; + +describe("issue 19603", () => { + beforeEach(() => { + restore(); + cy.signInAsAdmin(); + + // Archive second collection (nested under the first one) + cy.request("GET", "/api/collection/").then(({ body }) => { + const { id } = body.find(c => c.slug === "second_collection"); + + cy.archiveCollection(id); + }); + }); + + it("archived subcollection should not show up in permissions (metabase#19603)", () => { + cy.visit("/admin/permissions/collections"); + + cy.findByText("First collection").click(); + cy.findByText("Second collection").should("not.exist"); + }); +}); diff --git a/frontend/test/metabase/scenarios/permissions/reproductions/19603-do-not-show-archived-collections.cy.spec.js b/frontend/test/metabase/scenarios/permissions/reproductions/19603-do-not-show-archived-collections.cy.spec.js deleted file mode 100644 index 145012f762be6743b2af7e15081b97b38d1d3914..0000000000000000000000000000000000000000 --- a/frontend/test/metabase/scenarios/permissions/reproductions/19603-do-not-show-archived-collections.cy.spec.js +++ /dev/null @@ -1,32 +0,0 @@ -import { restore } from "__support__/e2e/cypress"; - -const UNARCHIVED_PARENT_NAME = "Unarchived parent"; -const ARCHIVED_NAME = "Archived child"; - -describe("issue 19603", () => { - beforeEach(() => { - restore(); - cy.signInAsAdmin(); - - cy.createCollection({ - name: UNARCHIVED_PARENT_NAME, - }).then(response => { - const { id: collectionId } = response.body; - cy.createCollection({ - name: ARCHIVED_NAME, - parent_id: collectionId, - archived: true, - }).then(response => { - const { id: archivedCollectionId } = response.body; - cy.archiveCollection(archivedCollectionId); - }); - }); - }); - - it("should not show archived collections on the collections permissions page (metabase#19603)", () => { - cy.visit("admin/permissions/collections"); - - cy.findByText(UNARCHIVED_PARENT_NAME).click(); - cy.findByText(ARCHIVED_NAME).should("not.exist"); - }); -});