@@ -8,23 +8,18 @@ context('Form', () => {
8
8
9
9
it ( 'should change input values' , ( ) => {
10
10
const nameText = 'John Deer' ;
11
- cy . get ( '[id="#/properties/name-input"]' ) . clear ( ) . type ( nameText ) ;
12
-
13
11
const descText = 'This is a desc test' ;
14
- cy . get ( '[id="#/properties/description-input"]' ) . clear ( ) . type ( descText ) ;
12
+ const recurrenceIntervalText = 10 ;
13
+ const dateText = '2001-03-15' ;
15
14
15
+ cy . get ( '[id="#/properties/name-input"]' ) . clear ( ) . type ( nameText ) ;
16
+ cy . get ( '[id="#/properties/description-input"]' ) . clear ( ) . type ( descText ) ;
16
17
cy . get ( '[id="#/properties/done-input"]' ) . uncheck ( ) ;
17
-
18
18
cy . get ( '[id="#/properties/recurrence"] > div' ) . click ( ) ;
19
19
cy . get ( '[data-value="Monthly"]' ) . click ( ) ;
20
-
21
- const recurrenceIntervalText = 10 ;
22
20
cy . get ( '[id="#/properties/recurrence_interval-input"]' ) . clear ( ) . type ( recurrenceIntervalText ) ;
23
-
24
- cy . get ( '[id="#/properties/due_date-input"]' ) . clear ( ) . type ( '35' ) ;
25
-
21
+ cy . get ( '[id="#/properties/due_date-input"]' ) . clear ( ) . type ( dateText ) ;
26
22
cy . get ( '[id="#/properties/rating"] span:last' ) . click ( ) ;
27
-
28
23
cy . get ( '[id="boundData"]' ) . invoke ( 'text' ) . then ( ( content => {
29
24
const data = JSON . parse ( content ) ;
30
25
@@ -37,19 +32,19 @@ context('Form', () => {
37
32
expect ( data . done ) . to . equal ( false ) ;
38
33
expect ( data . recurrence ) . to . equal ( 'Monthly' ) ;
39
34
expect ( data . recurrence_interval ) . to . equal ( recurrenceIntervalText ) ;
40
- expect ( data . due_date ) . to . equal ( '2001-03-15' ) ;
35
+ expect ( data . due_date ) . to . equal ( dateText ) ;
41
36
expect ( data . rating ) . to . equal ( 5 ) ;
42
37
} ) ) ;
43
38
} ) ;
44
39
45
40
it ( 'should show errors' , ( ) => {
46
41
cy . get ( '[id="#/properties/name-input"]' ) . clear ( ) ;
47
42
48
- cy . get ( '[id="#/properties/name"] p' ) . should ( 'not.be.empty' ) ;
43
+ cy . get ( '[id="#/properties/name"] p:first-child ' ) . should ( 'not.be.empty' ) ;
49
44
50
45
cy . get ( '[id="#/properties/due_date-input"]' ) . clear ( ) . type ( '351' ) ;
51
46
52
- cy . get ( '[id="#/properties/due_date"] p' ) . should ( 'not.be.empty' ) ;
47
+ cy . get ( '[id="#/properties/due_date"] p:first-child ' ) . should ( 'not.be.empty' ) ;
53
48
54
49
cy . get ( '[id="#/properties/recurrence"] > div' ) . click ( ) ;
55
50
cy . get ( '[data-value="Never"]' ) . click ( ) ;
0 commit comments