1
1
describe ( "delete TOTP connexion" , ( ) => {
2
- before ( ( ) => {
3
- cy . mailslurp ( ) . then ( ( mailslurp ) =>
4
- mailslurp . inboxController . deleteAllInboxEmails ( {
5
- inboxId : "eab4ab97-875d-4ec7-bdcc-04323948ee63" ,
6
- } ) ,
7
- ) ;
8
- cy . mailslurp ( ) . then ( ( mailslurp ) =>
9
- mailslurp . inboxController . deleteAllInboxEmails ( {
10
- inboxId : "c9fabb94-9274-4ece-a3d0-54b1987c8588" ,
11
- } ) ,
12
- ) ;
13
- } ) ;
14
-
15
2
it ( "should delete TOTP application" , function ( ) {
16
3
cy . visit ( "/connection-and-account" ) ;
17
4
@@ -23,21 +10,15 @@ describe("delete TOTP connexion", () => {
23
10
24
11
cy . contains ( "L’application d’authentification a bien été supprimée." ) ;
25
12
26
- cy . mailslurp ( )
27
- // use inbox id and a timeout of 30 seconds
28
- . then ( ( mailslurp ) =>
29
- mailslurp . waitForLatestEmail (
30
- "eab4ab97-875d-4ec7-bdcc-04323948ee63" ,
31
- 60000 ,
32
- true ,
33
- ) ,
34
- )
35
- // check subject of deletion email
36
- . then ( ( email ) => {
37
- expect ( email . subject ) . to . include (
38
- "Suppression d'une application d'authentification à double facteur" ,
39
- ) ;
40
- } ) ;
13
+ cy . maildevGetLastMessage ( ) . then ( ( email ) => {
14
+ expect ( email . subject ) . to . equal (
15
+ "Suppression d'une application d'authentification à double facteur" ,
16
+ ) ;
17
+ cy . maildevVisitMessageById ( email . id ) ;
18
+ cy . contains (
19
+ "L'application a été supprimée comme étape de connexion à deux facteurs." ,
20
+ ) ;
21
+ } ) ;
41
22
} ) ;
42
23
43
24
it ( "should not be ask to sign with TOTP" , function ( ) {
@@ -57,26 +38,22 @@ describe("delete TOTP connexion", () => {
57
38
58
39
cy . contains ( "Désactiver la validation en deux étapes" ) . click ( ) ;
59
40
60
- cy . mailslurp ( )
61
- // use inbox id and a timeout of 30 seconds
62
- . then ( ( mailslurp ) =>
63
- mailslurp . waitForLatestEmail (
64
- "c9fabb94-9274-4ece-a3d0-54b1987c8588" ,
65
- 60000 ,
66
- true ,
67
- ) ,
68
- )
69
- // check subject of deletion email
70
- . then ( ( email ) => {
71
- expect ( email . subject ) . to . include (
72
- "Désactivation de la validation en deux étapes" ,
73
- ) ;
74
- } ) ;
41
+ cy . maildevGetLastMessage ( ) . then ( ( email ) => {
42
+ console . log ( email ) ;
43
+
44
+ expect ( email . subject ) . to . equal (
45
+ "Suppression d'une application d'authentification à double facteur" ,
46
+ ) ;
47
+ cy . maildevVisitMessageById ( email . id ) ;
48
+ cy . contains (
49
+ "Votre compte MonComptePro n'est plus protégé par la validation en deux" ,
50
+ ) ;
51
+ } ) ;
75
52
} ) ;
76
53
77
54
it ( "should not be ask to sign with TOTP" , function ( ) {
78
55
cy . visit ( "http://localhost:4000" ) ;
79
- cy . get ( "button.proconnect -button" ) . click ( ) ;
56
+ cy . get ( "button.œproconnect -button" ) . click ( ) ;
80
57
cy . login ( "c9fabb94-9274-4ece-a3d0-54b1987c8588@mailslurp.com" ) ;
81
58
82
59
cy . contains ( '"amr": [\n "pwd"\n ],' ) ;
0 commit comments