@@ -17,21 +17,24 @@ context("Empty candidacy", () => {
17
17
} ) ;
18
18
19
19
context ( "Candidacy with department certification selected" , ( ) => {
20
- it ( "list all available organisms" , function ( ) {
20
+ beforeEach ( ( ) => {
21
21
cy . intercept ( "POST" , "/api/graphql" , ( req ) => {
22
22
stubMutation ( req , "candidate_login" , "candidate_login.json" ) ;
23
23
stubQuery ( req , "candidate_getCandidateWithCandidacy" , "candidate3.json" ) ;
24
24
stubQuery ( req , "getRandomOrganismsForCandidacy" , "organism.json" ) ;
25
25
stubQuery ( req , "activeFeaturesForConnectedUser" , "features.json" ) ;
26
26
} ) ;
27
+
27
28
cy . login ( ) ;
28
29
cy . wait ( "@candidate_login" ) ;
29
30
cy . wait ( "@candidate_getCandidateWithCandidacy" ) ;
30
31
cy . wait ( "@activeFeaturesForConnectedUser" ) ;
31
32
32
33
cy . get ( '[data-test="project-home-edit-organism' ) . click ( ) ;
33
34
cy . wait ( "@getRandomOrganismsForCandidacy" ) ;
35
+ } ) ;
34
36
37
+ it ( "list all available organisms" , function ( ) {
35
38
cy . get ( '[data-test="project-organisms-organism-o1"]' ) . within ( ( ) => {
36
39
cy . get ( '[data-test="project-organisms-organism-label"]' ) . should (
37
40
"have.text" ,
@@ -69,23 +72,7 @@ context("Candidacy with department certification selected", () => {
69
72
70
73
it ( "submit first organism" , function ( ) {
71
74
cy . intercept ( "POST" , "/api/graphql" , ( req ) => {
72
- stubMutation ( req , "candidate_login" , "candidate_login.json" ) ;
73
- stubQuery ( req , "candidate_getCandidateWithCandidacy" , "candidate3.json" ) ;
74
- stubQuery ( req , "getRandomOrganismsForCandidacy" , "organism.json" ) ;
75
75
stubMutation ( req , "candidacy_selectOrganism" , "selected-organism.json" ) ;
76
- stubQuery ( req , "activeFeaturesForConnectedUser" , "features.json" ) ;
77
- } ) ;
78
-
79
- cy . login ( ) ;
80
-
81
- cy . wait ( "@candidate_login" ) ;
82
- cy . wait ( "@candidate_getCandidateWithCandidacy" ) ;
83
- cy . wait ( "@activeFeaturesForConnectedUser" ) ;
84
-
85
- cy . get ( '[data-test="project-home-edit-organism' ) . click ( ) ;
86
- cy . wait ( "@getRandomOrganismsForCandidacy" ) ;
87
-
88
- cy . intercept ( "POST" , "/api/graphql" , ( req ) => {
89
76
stubQuery (
90
77
req ,
91
78
"candidate_getCandidateWithCandidacy" ,
0 commit comments