File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ describe('Test new User Registration Workflow', () => {
100100 } )
101101
102102 it ( 'Allows user to edit the story created by them' , ( ) => {
103- cy . get ( '[data-cy=btn-edit]' ) . contains ( 'Edit' ) . click ( )
103+ cy . get ( '[data-cy=btn-edit]' , { timeout : 1000 } ) . contains ( 'Edit' ) . click ( )
104104
105105 cy . get ( '[data-cy=edit-description]' ) . type ( editedDescription )
106106
@@ -114,9 +114,9 @@ describe('Test new User Registration Workflow', () => {
114114
115115 cy . get ( '[data-cy=stories]' ) . contains ( testStory . title ) . click ( )
116116
117- cy . get ( '[data-cy=comment-input]' ) . type ( testComment )
117+ cy . get ( '[data-cy=comment-input-2 ]' ) . type ( testComment )
118118
119- cy . get ( '[data-cy=btn-comment]' ) . contains ( 'Add Comment' ) . click ( )
119+ cy . get ( '[data-cy=btn-comment-2 ]' ) . contains ( 'Add Comment' ) . click ( )
120120
121121 cy . get ( '[data-cy=comment-content]' ) . contains ( testComment )
122122
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ const CommentForm = (props) => {
3939 cols = '25'
4040 name = 'Comments'
4141 value = { comment }
42+ data-cy = { `comment-input-${ id } ` }
4243 ref = { register ( { required : true } ) }
4344 onChange = { ( e ) => setComment ( e . target . value ) }
4445 > </ textarea >
@@ -57,7 +58,9 @@ const CommentForm = (props) => {
5758 </ div >
5859 { errors . Comments && < FormError message = 'Reply cannot be empty' /> }
5960 < MediaPreview attachments = { attachments } setAttachments = { setAttachments } />
60- < Button className = 'btn btn-default' > { cta } </ Button >
61+ < Button className = 'btn btn-default' data-cy = { `btn-comment-${ id } ` } >
62+ { cta }
63+ </ Button >
6164 </ form >
6265 )
6366}
You can’t perform that action at this time.
0 commit comments