@@ -15,7 +15,7 @@ describe('On application start', () => {
1515 // Since the stepper is separate from the screen itself, it doesn't matter which screen we join
1616 const stepsWithExpectedErrors = [ 'start' , 'authors' ]
1717 it ( 'should have errors in start and authors, but not in any other steps' , ( ) => {
18- cy . visit ( '/identifiers ' )
18+ cy . visit ( '/finish ' )
1919 stepsWithExpectedErrors . forEach ( ( step ) => {
2020 cy . checkThatStepperValidityIs ( false , step )
2121 } )
@@ -26,7 +26,6 @@ describe('On application start', () => {
2626 } )
2727 } )
2828 it ( 'should have error on preview' , ( ) => {
29- cy . visit ( '/start' )
3029 cy . dataCy ( 'text-validation-msg' )
3130 . should ( 'contain.text' , 'minimum' )
3231 } )
@@ -40,20 +39,16 @@ describe('From a fixed app', () => {
4039 cy . visit ( '/authors' )
4140 cy . dataCy ( 'btn-add-author' )
4241 . click ( )
43- cy . visit ( '/identifiers ' )
42+ cy . visit ( '/finish ' )
4443 } )
4544 it ( 'should have no errors' , ( ) => {
46- stepNames . forEach ( ( step ) => {
47- cy . checkThatStepperValidityIs ( true , step )
48- cy . checkThatAppValidityIs ( true )
49- } )
45+ cy . checkThatAppValidityIs ( true )
5046 } )
5147 it ( 'should validate screen Start' , ( ) => {
5248 cy . visit ( '/start' )
5349 cy . checkThatInputValidityIs ( true , 'message' )
5450 cy . dataCy ( 'input-title' )
5551 . clear ( )
56- cy . checkThatStepperValidityIs ( false , 'start' )
5752 cy . checkThatAppValidityIs ( false )
5853 cy . checkThatInputValidityIs ( false , 'title' )
5954 cy . get ( '.q-field__messages > div' )
@@ -65,7 +60,6 @@ describe('From a fixed app', () => {
6560 . should ( 'not.exist' )
6661
6762 cy . checkThatInputValidityIs ( true , 'message' )
68- cy . checkThatStepperValidityIs ( true , 'start' )
6963 cy . checkThatAppValidityIs ( true )
7064 } )
7165
@@ -77,13 +71,11 @@ describe('From a fixed app', () => {
7771 it ( 'should validate missing authors' , ( ) => {
7872 cy . dataCy ( 'btn-remove' )
7973 . click ( )
80- cy . checkThatStepperValidityIs ( false , 'authors' )
8174 cy . checkThatAppValidityIs ( false )
8275 cy . dataCy ( 'banner-error-messages' )
8376 . should ( 'contain.text' , 'Add at least one author' )
8477 cy . dataCy ( 'btn-add-author' )
8578 . click ( )
86- cy . checkThatStepperValidityIs ( true , 'authors' )
8779 cy . checkThatAppValidityIs ( true )
8880 } )
8981 it ( 'should validate duplicate authors' , ( ) => {
@@ -104,14 +96,12 @@ describe('From a fixed app', () => {
10496
10597 cy . dataCy ( 'card-author0' )
10698 . should ( 'have.class' , 'red-border' )
107- cy . checkThatStepperValidityIs ( false , 'authors' )
10899 cy . checkThatAppValidityIs ( false )
109100 cy . dataCy ( 'banner-error-messages' )
110101 . should ( 'contain.text' , 'There are duplicate authors' )
111102
112103 cy . dataCy ( 'btn-remove0' )
113104 . click ( )
114- cy . checkThatStepperValidityIs ( true , 'authors' )
115105 cy . checkThatAppValidityIs ( true )
116106 } )
117107 it ( 'should validate authors\' fields' , ( ) => {
@@ -121,25 +111,21 @@ describe('From a fixed app', () => {
121111 . click ( )
122112 cy . dataCy ( 'input-email' )
123113 . type ( 'a' )
124- cy . checkThatStepperValidityIs ( false , 'authors' )
125114 cy . checkThatInputValidityIs ( false , 'email' )
126115 cy . checkThatAppValidityIs ( false )
127116 cy . dataCy ( 'input-email' )
128117 . type ( '@a.com' )
129- cy . checkThatStepperValidityIs ( true , 'authors' )
130118 cy . checkThatInputValidityIs ( true , 'email' )
131119 cy . checkThatAppValidityIs ( true )
132120
133121 cy . dataCy ( 'input-orcid' )
134122 . type ( '1' )
135- cy . checkThatStepperValidityIs ( false , 'authors' )
136123 cy . checkThatInputValidityIs ( false , 'orcid' )
137124 cy . checkThatAppValidityIs ( false )
138125 cy . dataCy ( 'input-orcid' )
139126 . type ( '23412341234123X' )
140127 . parents ( '.q-field' )
141128 . should ( 'not.have.class' , 'q-field--error' )
142- cy . checkThatStepperValidityIs ( true , 'authors' )
143129 cy . checkThatAppValidityIs ( true )
144130 } )
145131 } )
@@ -151,47 +137,39 @@ describe('From a fixed app', () => {
151137 it ( 'should validate value' , ( ) => {
152138 cy . dataCy ( 'btn-add-identifier' )
153139 . click ( )
154- cy . checkThatStepperValidityIs ( false , 'identifiers' )
155140 cy . checkThatInputValidityIs ( false , 'value' )
156141 cy . checkThatAppValidityIs ( false )
157142 cy . dataCy ( 'input-value' )
158143 . type ( '10.1234/x' )
159- cy . checkThatStepperValidityIs ( true , 'identifiers' )
160144 cy . checkThatInputValidityIs ( true , 'value' )
161145 cy . checkThatAppValidityIs ( true )
162146 cy . dataCy ( 'input-value' )
163147 . clear ( )
164148 . type ( 'bad' )
165- cy . checkThatStepperValidityIs ( false , 'identifiers' )
166149 cy . checkThatInputValidityIs ( false , 'value' )
167150 cy . checkThatAppValidityIs ( false )
168151
169152 cy . dataCy ( 'radio-identifier-url' )
170153 . click ( )
171- cy . checkThatStepperValidityIs ( false , 'identifiers' )
172154 cy . checkThatInputValidityIs ( false , 'value' )
173155 cy . checkThatAppValidityIs ( false )
174156 cy . dataCy ( 'input-value' )
175157 . clear ( )
176158 . type ( 'https://a' )
177- cy . checkThatStepperValidityIs ( true , 'identifiers' )
178159 cy . checkThatInputValidityIs ( true , 'value' )
179160 cy . checkThatAppValidityIs ( true )
180161 cy . dataCy ( 'input-value' )
181162 . clear ( )
182- cy . checkThatStepperValidityIs ( false , 'identifiers' )
183163 cy . checkThatInputValidityIs ( false , 'value' )
184164 cy . checkThatAppValidityIs ( false )
185165
186166 cy . dataCy ( 'radio-identifier-swh' )
187167 . click ( )
188- cy . checkThatStepperValidityIs ( false , 'identifiers' )
189168 cy . checkThatInputValidityIs ( false , 'value' )
190169 cy . checkThatAppValidityIs ( false )
191170 cy . dataCy ( 'input-value' )
192171 . clear ( )
193172 . type ( 'swh:1:rev:0123456789abcdef0123456789abcdef01234567' )
194- cy . checkThatStepperValidityIs ( true , 'identifiers' )
195173 cy . checkThatInputValidityIs ( true , 'value' )
196174 cy . checkThatAppValidityIs ( true )
197175 } )
@@ -213,11 +191,9 @@ describe('From a fixed app', () => {
213191 . should ( 'have.class' , 'red-border' )
214192 cy . dataCy ( 'banner-error-messages' )
215193 . should ( 'contain.text' , 'There are duplicate identifier' )
216- cy . checkThatStepperValidityIs ( false , 'identifiers' )
217194 cy . checkThatAppValidityIs ( false )
218195 cy . dataCy ( 'btn-remove0' )
219196 . click ( )
220- cy . checkThatStepperValidityIs ( true , 'identifiers' )
221197 cy . checkThatAppValidityIs ( true )
222198 } )
223199 } )
@@ -228,23 +204,19 @@ describe('From a fixed app', () => {
228204 fields . forEach ( ( field ) => {
229205 cy . dataCy ( `input-${ field } ` )
230206 . type ( 'bad' )
231- cy . checkThatStepperValidityIs ( false , 'related-resources' )
232207 cy . checkThatInputValidityIs ( false , field )
233208 cy . checkThatAppValidityIs ( false )
234209 cy . dataCy ( `input-${ field } ` )
235210 . clear ( )
236211 . type ( 'https://a' )
237- cy . checkThatStepperValidityIs ( true , 'related-resources' )
238212 cy . checkThatInputValidityIs ( true , field )
239213 cy . checkThatAppValidityIs ( true )
240214 cy . dataCy ( `input-${ field } ` )
241215 . type ( ' ' )
242- cy . checkThatStepperValidityIs ( false , 'related-resources' )
243216 cy . checkThatInputValidityIs ( false , field )
244217 cy . checkThatAppValidityIs ( false )
245218 cy . dataCy ( `input-${ field } ` )
246219 . clear ( )
247- cy . checkThatStepperValidityIs ( true , 'related-resources' )
248220 cy . checkThatInputValidityIs ( true , field )
249221 cy . checkThatAppValidityIs ( true )
250222 } )
@@ -258,12 +230,10 @@ describe('From a fixed app', () => {
258230 cy . dataCy ( 'btn-add-keyword' )
259231 . click ( )
260232 cy . checkThatInputValidityIs ( false , 'keyword0' )
261- cy . checkThatStepperValidityIs ( false , 'keywords' )
262233 cy . checkThatAppValidityIs ( false )
263234 cy . dataCy ( 'input-keyword0' )
264235 . type ( 'a' )
265236 cy . checkThatInputValidityIs ( true , 'keyword0' )
266- cy . checkThatStepperValidityIs ( true , 'keywords' )
267237 cy . checkThatAppValidityIs ( true )
268238 } )
269239 it ( 'should validate duplicate keywords' , ( ) => {
@@ -274,15 +244,13 @@ describe('From a fixed app', () => {
274244 cy . checkThatInputValidityIs ( false , 'keyword1' )
275245 cy . dataCy ( 'banner-error-messages' )
276246 . should ( 'contain.text' , 'There are duplicate keywords' )
277- cy . checkThatStepperValidityIs ( false , 'keywords' )
278247 cy . checkThatAppValidityIs ( false )
279248 cy . dataCy ( 'input-keyword0' )
280249 . type ( 'a' )
281250 cy . dataCy ( 'input-keyword1' )
282251 . type ( 'b' )
283252 cy . checkThatInputValidityIs ( true , 'keyword0' )
284253 cy . checkThatInputValidityIs ( true , 'keyword1' )
285- cy . checkThatStepperValidityIs ( true , 'keywords' )
286254 cy . checkThatAppValidityIs ( true )
287255 } )
288256 } )
@@ -292,13 +260,11 @@ describe('From a fixed app', () => {
292260 cy . dataCy ( 'input-date-released' )
293261 . type ( '1' )
294262 cy . checkThatInputValidityIs ( false , 'date-released' )
295- cy . checkThatStepperValidityIs ( false , 'version-specific' )
296263 cy . checkThatAppValidityIs ( false )
297264 cy . dataCy ( 'input-date-released' )
298265 . type ( '1111111' )
299266 . parents ( '.q-field' )
300267 . should ( 'not.have.class' , 'q-field--error' )
301- cy . checkThatStepperValidityIs ( true , 'version-specific' )
302268 cy . checkThatAppValidityIs ( true )
303269 } )
304270} )
0 commit comments