Skip to content

Commit

Permalink
feat(email): use smtp protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
douglasduteil committed Oct 18, 2024
1 parent bc4c527 commit ba23b26
Show file tree
Hide file tree
Showing 9 changed files with 268 additions and 76 deletions.
65 changes: 21 additions & 44 deletions cypress/e2e/delete_totp/index.cy.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
describe("delete TOTP connexion", () => {
before(() => {
cy.mailslurp().then((mailslurp) =>
mailslurp.inboxController.deleteAllInboxEmails({
inboxId: "eab4ab97-875d-4ec7-bdcc-04323948ee63",
}),
);
cy.mailslurp().then((mailslurp) =>
mailslurp.inboxController.deleteAllInboxEmails({
inboxId: "c9fabb94-9274-4ece-a3d0-54b1987c8588",
}),
);
});

it("should delete TOTP application", function () {
cy.visit("/connection-and-account");

Expand All @@ -23,21 +10,15 @@ describe("delete TOTP connexion", () => {

cy.contains("L’application d’authentification a bien été supprimée.");

cy.mailslurp()
// use inbox id and a timeout of 30 seconds
.then((mailslurp) =>
mailslurp.waitForLatestEmail(
"eab4ab97-875d-4ec7-bdcc-04323948ee63",
60000,
true,
),
)
// check subject of deletion email
.then((email) => {
expect(email.subject).to.include(
"Suppression d'une application d'authentification à double facteur",
);
});
cy.maildevGetLastMessage().then((email) => {
expect(email.subject).to.equal(
"Suppression d'une application d'authentification à double facteur",
);
cy.maildevVisitMessageById(email.id);
cy.contains(
"L'application a été supprimée comme étape de connexion à deux facteurs.",
);
});
});

it("should not be ask to sign with TOTP", function () {
Expand All @@ -57,26 +38,22 @@ describe("delete TOTP connexion", () => {

cy.contains("Désactiver la validation en deux étapes").click();

cy.mailslurp()
// use inbox id and a timeout of 30 seconds
.then((mailslurp) =>
mailslurp.waitForLatestEmail(
"c9fabb94-9274-4ece-a3d0-54b1987c8588",
60000,
true,
),
)
// check subject of deletion email
.then((email) => {
expect(email.subject).to.include(
"Désactivation de la validation en deux étapes",
);
});
cy.maildevGetLastMessage().then((email) => {
console.log(email);

expect(email.subject).to.equal(
"Suppression d'une application d'authentification à double facteur",
);
cy.maildevVisitMessageById(email.id);
cy.contains(
"Votre compte MonComptePro n'est plus protégé par la validation en deux",
);
});
});

it("should not be ask to sign with TOTP", function () {
cy.visit("http://localhost:4000");
cy.get("button.proconnect-button").click();
cy.get("button.œproconnect-button").click();
cy.login("[email protected]");

cy.contains('"amr": [\n "pwd"\n ],');
Expand Down
Loading

0 comments on commit ba23b26

Please sign in to comment.