Skip to content

Commit e77ca1a

Browse files
committed
✅ add test for feature prefilled siret
1 parent f1b0398 commit e77ca1a

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

cypress/e2e/signup_with_prefilled_siret/env.conf

Whitespace-only changes.

cypress/e2e/signup_with_prefilled_siret/fixtures.sql

Whitespace-only changes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
//
2+
3+
describe("sign-up with prefilled siret", () => {
4+
it("should seed the database once", function () {
5+
cy.seed();
6+
});
7+
8+
it("should sign-up with magic link and have a siret that is prefilled with 11009001600053", function () {
9+
// Visit the signup page
10+
cy.visit("/users/start-sign-in");
11+
12+
cy.get('[name="login"]').type("user@intradef.gouv.fr");
13+
cy.get('[type="submit"]').click();
14+
15+
cy.get('[name="password"]').type(
16+
"This super secret password is hidden well!",
17+
);
18+
cy.get('[action="/users/sign-up"] [type="submit"]').click();
19+
20+
// Check that the website is waiting for the user to verify their email
21+
cy.get("#verify-email > div > p").contains("user@intradef.gouv.fr");
22+
23+
cy.verifyEmail();
24+
25+
// Fill the user's personal information
26+
cy.get('[name="given_name"]').type("Loïs");
27+
cy.get('[name="family_name"]').type("Lane");
28+
cy.get('[type="submit"]').click();
29+
30+
// The siret should be prefilled
31+
cy.get('[name="siret"]').should("have.value", "11009001600053");
32+
});
33+
});

0 commit comments

Comments
 (0)