Skip to content

Commit d35b166

Browse files
committed
Change registration cypress test
Since we run a force logout on the user after registration we need to change the registration test.
1 parent 927b078 commit d35b166

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

cypress/e2e/adgangsplatformen.cy.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ describe("Adgangsplatformen", () => {
9292
cy.get(".footer").should("not.exist");
9393
});
9494

95-
it("can register a new user and expose the right tokens for the react apps", () => {
95+
it("can register a new user - expose the right tokens for the react apps - and force logout.", () => {
9696
cy.setupAdgangsplatformenRegisterMappinngs({
9797
authorizationCode: "7c5e3213aea6ef42ec97dfeaa6f5b1d454d856dc",
9898
accessToken: "447131b0a03fe0421204c54e5c21a60-new-user",
@@ -120,12 +120,12 @@ describe("Adgangsplatformen", () => {
120120
cy.get('[data-cy="pincode-confirm-input"]').type("1234");
121121
cy.get("#branches-dropdown").select("DK-775100");
122122
cy.get('[data-cy="complete-user-registration-button"]').click();
123-
cy.request("/dpl-react/user-tokens").then((response) => {
124-
expect(response.body).contain(
125-
'window.dplReact = window.dplReact || {};\nwindow.dplReact.setToken("user", "447131b0a03fe0421204c54e5c21a60-new-user")'
126-
);
127-
expect(response.body).not.contain(
128-
'window.dplReact = window.dplReact || {};\nwindow.dplReact.setToken("unregistered-user", "447131b0a03fe0421204c54e5c21a60-new-user")'
123+
cy.get('[data-cy="button"]').click();
124+
cy.origin("login.bib.dk", () => {
125+
cy.url().should("to.match", /^https:\/\/login.bib.dk\/logout\?.*/);
126+
cy.url().should(
127+
"to.match",
128+
/.*redirect_uri=.*\/login%3Fcurrent-path%3D\/velkommen.*/
129129
);
130130
});
131131
});

0 commit comments

Comments
 (0)