Skip to content

Commit 757da7f

Browse files
authored
Merge pull request #1436 from proconnect-gouv/douglasduteil/fix-disalbed-return-button-in-form
2 parents 9055562 + 27f18af commit 757da7f

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

cypress/e2e/join_with_code_sent_to_official_contact_email/index.cy.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe("join collectivité territoriale with code send to official contact ema
4040
});
4141

4242
cy.go("back");
43+
cy.title().should("include", "Vérifier votre email -");
4344

4445
cy.get<string>("@code").then((code) => {
4546
cy.contains("Insérer le code reçu").click();
@@ -83,6 +84,7 @@ describe("join collectivité territoriale with code send to official contact ema
8384
});
8485

8586
cy.go("back");
87+
cy.title().should("include", "Vérifier votre email -");
8688

8789
cy.get<string>("@code").then((code) => {
8890
cy.contains("Insérer le code reçu").click();

cypress/e2e/join_with_code_sent_to_official_educ_nat_contact_email/index.cy.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ describe("join organizations", () => {
77

88
it("join collectivité territoriale with code send to official contact email", function () {
99
cy.visit("/users/join-organization");
10+
11+
cy.title().should("include", "S'inscrire ou se connecter -");
1012
cy.login("konrad.curze@nightlords.world");
1113

12-
cy.get('[name="siret"]').type("19750663700010");
13-
cy.get('[type="submit"]').click();
14+
cy.title().should("include", "Rejoindre une organisation -");
15+
cy.contains("SIRET de l’organisation que vous représentez").click();
16+
cy.focused().clear().type("19750663700010");
17+
cy.contains("Enregistrer").click();
1418

19+
cy.title().should("include", "Vérifier votre email -");
1520
// Check that the website is waiting for the user to verify their email
1621
cy.contains(
1722
"nous avons envoyé un code à l’adresse email officielle de votre établissement scolaire",
@@ -34,13 +39,16 @@ describe("join organizations", () => {
3439
});
3540

3641
cy.go("back");
42+
cy.title().should("include", "Vérifier votre email -");
3743

3844
cy.get<string>("@code").then((code) => {
3945
cy.log(code);
40-
cy.get('[name="official_contact_email_verification_token"]').type(code);
41-
cy.get('[type="submit"]').click();
46+
cy.contains("Insérer le code reçu").click();
47+
cy.focused().clear().type(code);
48+
cy.contains("Valider").click();
4249
});
4350

51+
cy.title().should("include", "Compte créé -");
4452
cy.contains("Votre compte est créé !");
4553
});
4654
});

src/views/user/official-contact-email-verification.ejs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<form id="verify-email" action="/users/official-contact-email-verification/<%= organization_id %>" method="post" autocomplete="off">
99
<p>
1010
Pour vérifier votre appartenance à l’organisation <%= libelle %>,
11-
nous avons envoyé un <% if (newCodeSent) { %>nouveau <% } %>code à l’adresse email officielle de votre <%= organization_type_label; %> :
11+
nous avons envoyé un <% if (newCodeSent) { %>nouveau <% } %> code à l’adresse email officielle de votre <%= organization_type_label; %> :
1212
<span class="fr-badge fr-badge--info fr-badge--no-icon email-badge-lowercase">
1313
<%= contactEmail; %>
1414
</span>.
@@ -38,8 +38,8 @@
3838
</a>
3939
</p>
4040
</div>
41-
<%- include('../partials/go-back.ejs') %>
4241
</form>
42+
<%- include('../partials/go-back.ejs') %>
4343
</div>
4444
</div>
4545
</div>

0 commit comments

Comments
 (0)