Skip to content

Commit

Permalink
chore: synchronize workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Sep 19, 2024
1 parent 85e0d0a commit 440d263
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 23 deletions.
2 changes: 1 addition & 1 deletion courier/template/sms/verification_code_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestNewOTPMessage(t *testing.T) {

tpl := sms.NewVerificationCodeValid(reg, &sms.VerificationCodeValidModel{To: expectedPhone, VerificationCode: otp})

expectedBody := fmt.Sprintf("Your verification code is: %s\\n\\nIf this was not you, do nothing. It expires in 0 minutes.\\n", otp)
expectedBody := fmt.Sprintf("Your verification code is: %s\n\nIf this was not you, do nothing. It expires in 0 minutes.\n", otp)

actualBody, err := tpl.SMSBody(context.Background())
require.NoError(t, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,7 @@ context("Registration success with code method", () => {
cy.get(Selectors[app]["tos"]).click()

cy.submitCodeForm(app)
cy.get('[data-testid="ui/message/1040005"]').should(
"contain",
"An email containing a code has been sent to the email address you provided",
)
cy.get('[data-testid="ui/message/1040005"]').should("be.visible")

cy.getRegistrationCodeFromEmail(email).then((code) =>
cy.wrap(code).as("code1"),
Expand Down Expand Up @@ -166,10 +163,7 @@ context("Registration success with code method", () => {
cy.get(Selectors[app]["tos"]).click()

cy.submitCodeForm(app)
cy.get('[data-testid="ui/message/1040005"]').should(
"contain",
"An email containing a code has been sent to the email address you provided",
)
cy.get('[data-testid="ui/message/1040005"]').should("be.visible")

cy.getRegistrationCodeFromEmail(email).should((code) => {
cy.get(Selectors[app]["code"]).type(code)
Expand Down Expand Up @@ -216,10 +210,7 @@ context("Registration success with code method", () => {
cy.get(Selectors[app]["tos"]).click()

cy.submitCodeForm(app)
cy.get('[data-testid="ui/message/1040005"]').should(
"contain",
"An email containing a code has been sent to the email address you provided",
)
cy.get('[data-testid="ui/message/1040005"]').should("be.visible")

cy.getRegistrationCodeFromEmail(email).should((code) => {
cy.get(Selectors[app]["code"]).type(code)
Expand Down Expand Up @@ -329,10 +320,7 @@ context("Registration success with code method", () => {
cy.get(Selectors[app]["email2"]).type(email2)

cy.submitCodeForm(app)
cy.get('[data-testid="ui/message/1040005"]').should(
"contain",
"An email containing a code has been sent to the email address you provided",
)
cy.get('[data-testid="ui/message/1040005"]').should("be.visible")

// intentionally use email 1 to sign up for the account
cy.getRegistrationCodeFromEmail(email, { expectedCount: 1 }).should(
Expand Down
16 changes: 11 additions & 5 deletions test/e2e/cypress/integration/profiles/oidc-provider/login.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,14 +218,20 @@ context("OpenID Provider - change between flows", () => {
})

it("switch to recovery flow with password reset", () => {
cy.updateConfigFile((config) => {
config.selfservice.flows.recovery.lifespan = "1m"
config.selfservice.methods.link.config.lifespan = "1m"
config.selfservice.flows.verification.enabled = false
if (!config.selfservice.flows.recovery) {
config.selfservice.flows.recovery = {}
}
config.selfservice.flows.recovery.enabled = true
config.selfservice.flows.settings.privileged_session_max_age = "5m"
return config
})
cy.deleteMail()
cy.longRecoveryLifespan()
cy.longLinkLifespan()
cy.disableVerification()
cy.enableRecovery()
cy.useRecoveryStrategy("code")
cy.notifyUnknownRecipients("recovery", false)
cy.longPrivilegedSessionTime()

const identity = gen.identityWithWebsite()
cy.registerApi(identity)
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/cypress/support/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,7 @@ Cypress.Commands.add(
cy.getMail({
removeMail: true,
email,
subject: "Recover access to your account",
body: "Recover access to your account",
}).should((message) => {
const code = extractOTPCode(message.body)
expect(code).to.not.be.undefined
Expand Down

0 comments on commit 440d263

Please sign in to comment.