Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: don't fail logout if cookie is not found #3871

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ context("Social Sign In Successes", () => {
cy.loginOidc({ app, url: login })
})

it.only("should be able to sign up and link existing account", () => {
it("should be able to sign up and link existing account", () => {
const email = gen.email()
const password = gen.password()

Expand Down
5 changes: 3 additions & 2 deletions test/e2e/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -922,8 +922,9 @@ Cypress.Commands.add("logout", () => {
const c = cookies.find(
({ name }) => name.indexOf("ory_kratos_session") > -1,
)
expect(c).to.not.be.undefined
cy.clearCookie(c.name)
if (c) {
cy.clearCookie(c.name)
}
Comment on lines +925 to +927
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The end goal is to remove the cookie. If it doesn't exist in the first place, this action should not fail, IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure I understand this, however it is fine by me to change the check as long as we have the assertion after login. Can you confirm that we assert the cookie after successful login?

})
cy.noSession()
})
Expand Down
Loading