File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -34,16 +34,18 @@ describe("Comments API", function () {
34
34
35
35
context ( "GET /comments/:transactionId" , function ( ) {
36
36
it ( "gets a list of comments for a transaction" , function ( ) {
37
- cy . request ( "GET" , `${ apiComments } /${ ctx . transactionId } ` ) . then ( ( response ) => {
37
+ const transactionId = ctx . transactionId ! ;
38
+ cy . request ( "GET" , `${ apiComments } /${ transactionId } ` ) . then ( ( response ) => {
38
39
expect ( response . status ) . to . eq ( 200 ) ;
39
- expect ( response . body . comments . length ) . to . eq ( 1 ) ;
40
+ expect ( response . body . comments ) . to . be . an ( "array" ) . that . has . length ( 1 ) ;
40
41
} ) ;
41
42
} ) ;
42
43
} ) ;
43
44
44
45
context ( "POST /comments/:transactionId" , function ( ) {
45
46
it ( "creates a new comment for a transaction" , function ( ) {
46
- cy . request ( "POST" , `${ apiComments } /${ ctx . transactionId } ` , {
47
+ const transactionId = ctx . transactionId ! ;
48
+ cy . request ( "POST" , `${ apiComments } /${ transactionId } ` , {
47
49
content : "This is my comment" ,
48
50
} ) . then ( ( response ) => {
49
51
expect ( response . status ) . to . eq ( 200 ) ;
Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ describe("Contacts API", function () {
63
63
} ,
64
64
} ) . then ( ( response ) => {
65
65
expect ( response . status ) . to . eq ( 422 ) ;
66
- expect ( response . body . errors . length ) . to . eq ( 1 ) ;
66
+ expect ( response . body . errors ) . to . be . an ( "array" ) . that . has . length ( 1 ) ;
67
67
} ) ;
68
68
} ) ;
69
69
} ) ;
You can’t perform that action at this time.
0 commit comments