From 13158e68b972324ca2eba89004dd977c4349285c Mon Sep 17 00:00:00 2001 From: Dean Date: Fri, 19 Aug 2022 15:56:12 +0100 Subject: [PATCH] Ensure OIDC config is disabled to prevent auth issues in test suite --- .../adminAndManagement/authentication.spec.js | 23 +++++++++++++++++++ .../builder/portal/manage/auth/index.svelte | 1 + 2 files changed, 24 insertions(+) diff --git a/packages/builder/cypress/integration/adminAndManagement/authentication.spec.js b/packages/builder/cypress/integration/adminAndManagement/authentication.spec.js index 8bdbd69db0..5cc42cb59a 100644 --- a/packages/builder/cypress/integration/adminAndManagement/authentication.spec.js +++ b/packages/builder/cypress/integration/adminAndManagement/authentication.spec.js @@ -7,6 +7,29 @@ filterTests(["smoke", "all"], () => { cy.login() }) + after(() => { + cy.get(".spectrum-SideNav li").contains("Auth").click() + cy.location().should(loc => { + expect(loc.pathname).to.eq("/builder/portal/manage/auth") + }) + + cy.get("[data-cy=new-scope-input]").clear() + + cy.get("div.content").scrollTo("bottom") + cy.get("[data-cy=oidc-active]").click() + + cy.get("[data-cy=oidc-active]").should('not.be.checked') + + cy.intercept("POST", "/api/global/configs").as("updateAuth") + cy.get("button[data-cy=oidc-save]").contains("Save").click({force: true}) + cy.wait("@updateAuth") + cy.get("@updateAuth").its("response.statusCode").should("eq", 200) + + cy.get(".spectrum-Toast-content") + .contains("Settings saved") + .should("be.visible") + }) + it("Should allow updating of the OIDC config", () => { cy.get(".spectrum-SideNav li").contains("Auth").click() cy.location().should(loc => { diff --git a/packages/builder/src/pages/builder/portal/manage/auth/index.svelte b/packages/builder/src/pages/builder/portal/manage/auth/index.svelte index b1006ad294..fc56c2cdef 100644 --- a/packages/builder/src/pages/builder/portal/manage/auth/index.svelte +++ b/packages/builder/src/pages/builder/portal/manage/auth/index.svelte @@ -408,6 +408,7 @@