@@ -27,10 +27,7 @@ describe('On application start', () => {
2727 } )
2828 it ( 'should have error on preview' , ( ) => {
2929 cy . visit ( '/start' )
30- cy . dataCy ( 'ta-cff-preview' )
31- . should ( 'have.class' , 'error' )
3230 cy . dataCy ( 'text-validation-msg' )
33- . should ( 'have.class' , 'invalid' )
3431 . should ( 'contain.text' , 'minimum' )
3532 } )
3633} )
@@ -48,11 +45,7 @@ describe('From a fixed advanced app', () => {
4845 it ( 'should have no errors' , ( ) => {
4946 allStepNames . forEach ( ( step ) => {
5047 cy . checkThatStepperValidityIs ( true , step )
51- cy . dataCy ( 'ta-cff-preview' )
52- . should ( 'not.have.class' , 'error' )
53- cy . dataCy ( 'text-validation-msg' )
54- . should ( 'not.have.class' , 'invalid' )
55- . should ( 'contain.text' , 'Your CITATION.cff is valid' )
48+ cy . checkThatAppValidityIs ( true )
5649 } )
5750 } )
5851 it ( 'should validate screen Start' , ( ) => {
@@ -61,11 +54,7 @@ describe('From a fixed advanced app', () => {
6154 cy . dataCy ( 'input-title' )
6255 . clear ( )
6356 cy . checkThatStepperValidityIs ( false , 'start' )
64- cy . dataCy ( 'ta-cff-preview' )
65- . should ( 'have.class' , 'error' )
66- cy . dataCy ( 'text-validation-msg' )
67- . should ( 'have.class' , 'invalid' )
68- . should ( 'contain.text' , 'minimum' )
57+ cy . checkThatAppValidityIs ( false )
6958 cy . checkThatInputValidityIs ( false , 'title' )
7059 cy . get ( '.q-field__messages > div' )
7160 . should ( 'have.length' , 1 )
@@ -77,11 +66,7 @@ describe('From a fixed advanced app', () => {
7766
7867 cy . checkThatInputValidityIs ( true , 'message' )
7968 cy . checkThatStepperValidityIs ( true , 'start' )
80- cy . dataCy ( 'ta-cff-preview' )
81- . should ( 'not.have.class' , 'error' )
82- cy . dataCy ( 'text-validation-msg' )
83- . should ( 'not.have.class' , 'invalid' )
84- . should ( 'contain.text' , 'Your CITATION.cff is valid' )
69+ cy . checkThatAppValidityIs ( true )
8570 } )
8671
8772 describe ( 'On screen Authors' , ( ) => {
@@ -93,21 +78,13 @@ describe('From a fixed advanced app', () => {
9378 cy . dataCy ( 'btn-remove' )
9479 . click ( )
9580 cy . checkThatStepperValidityIs ( false , 'authors' )
96- cy . dataCy ( 'ta-cff-preview' )
97- . should ( 'have.class' , 'error' )
98- cy . dataCy ( 'text-validation-msg' )
99- . should ( 'have.class' , 'invalid' )
100- . should ( 'contain.text' , 'minimum' )
81+ cy . checkThatAppValidityIs ( false )
10182 cy . get ( '.q-banner' )
10283 . should ( 'contain.text' , 'Use the button to add an author' )
10384 cy . dataCy ( 'btn-add-author' )
10485 . click ( )
10586 cy . checkThatStepperValidityIs ( true , 'authors' )
106- cy . dataCy ( 'ta-cff-preview' )
107- . should ( 'not.have.class' , 'error' )
108- cy . dataCy ( 'text-validation-msg' )
109- . should ( 'not.have.class' , 'invalid' )
110- . should ( 'contain.text' , 'Your CITATION.cff is valid' )
87+ cy . checkThatAppValidityIs ( true )
11188 } )
11289 it ( 'should validate duplicate authors' , ( ) => {
11390 cy . dataCy ( 'btn-remove' )
@@ -126,24 +103,16 @@ describe('From a fixed advanced app', () => {
126103 . click ( )
127104
128105 cy . dataCy ( 'card-author0' )
129- . should ( 'have.class' , 'has-error ' )
106+ . should ( 'have.class' , 'red-border ' )
130107 cy . checkThatStepperValidityIs ( false , 'authors' )
131- cy . dataCy ( 'ta-cff-preview' )
132- . should ( 'have.class' , 'error' )
133- cy . dataCy ( 'text-validation-msg' )
134- . should ( 'have.class' , 'invalid' )
135- . should ( 'contain.text' , 'minimum' )
108+ cy . checkThatAppValidityIs ( false )
136109 cy . get ( '.q-banner' )
137110 . should ( 'contain.text' , 'There are duplicate authors' )
138111
139112 cy . dataCy ( 'btn-remove0' )
140113 . click ( )
141114 cy . checkThatStepperValidityIs ( true , 'authors' )
142- cy . dataCy ( 'ta-cff-preview' )
143- . should ( 'not.have.class' , 'error' )
144- cy . dataCy ( 'text-validation-msg' )
145- . should ( 'not.have.class' , 'invalid' )
146- . should ( 'contain.text' , 'Your CITATION.cff is valid' )
115+ cy . checkThatAppValidityIs ( true )
147116 } )
148117 it ( 'should validate authors\' fields' , ( ) => {
149118 cy . dataCy ( 'btn-remove' )
@@ -169,7 +138,7 @@ describe('From a fixed advanced app', () => {
169138 cy . dataCy ( 'input-orcid' )
170139 . type ( '23412341234123X' )
171140 . parents ( '.q-field' )
172- . should ( 'not.have.class' , 'has -error' )
141+ . should ( 'not.have.class' , 'q-field- -error' )
173142 cy . checkThatStepperValidityIs ( true , 'authors' )
174143 cy . checkThatAppValidityIs ( true )
175144 } )
@@ -241,7 +210,7 @@ describe('From a fixed advanced app', () => {
241210 cy . dataCy ( 'btn-done' )
242211 . click ( )
243212 cy . dataCy ( 'card-identifier0' )
244- . should ( 'have.class' , 'has-error ' )
213+ . should ( 'have.class' , 'red-border ' )
245214 cy . get ( '.q-banner' )
246215 . should ( 'contain.text' , 'There are duplicate identifier' )
247216 cy . checkThatStepperValidityIs ( false , 'identifiers' )
@@ -328,7 +297,7 @@ describe('From a fixed advanced app', () => {
328297 cy . dataCy ( 'input-date-released' )
329298 . type ( '1111111' )
330299 . parents ( '.q-field' )
331- . should ( 'not.have.class' , 'has -error' )
300+ . should ( 'not.have.class' , 'q-field- -error' )
332301 cy . checkThatStepperValidityIs ( true , 'version-specific' )
333302 cy . checkThatAppValidityIs ( true )
334303 } )
0 commit comments