1
1
import existingUser from 'test-utils/mocks/existingUser' ;
2
2
import { mockUser } from 'test-utils/mockGenerators/mockUser' ;
3
3
import { validationErrorMessages } from 'common/constants/messages' ;
4
- import { SUCCESS_PAGE_MESSAGE } from 'common/constants/testIDs' ;
4
+ import {
5
+ SUCCESS_PAGE_MESSAGE ,
6
+ REGISTRATION_FORM_INITIAL_SUBMIT_BUTTON ,
7
+ } from 'common/constants/testIDs' ;
5
8
6
9
const getValidUser = ( ) => mockUser ( ) ;
7
10
const inputFields = {
@@ -28,7 +31,7 @@ const assertFailedLogin = ({
28
31
numberOfErrors = 1 ,
29
32
errorMessage = validationErrorMessages . required ,
30
33
} = { } ) => {
31
- cy . findByText ( 'Submit' ) . click ( ) ;
34
+ cy . findByTestId ( REGISTRATION_FORM_INITIAL_SUBMIT_BUTTON ) . click ( ) ;
32
35
cy . url ( ) . should ( 'contain' , '/join' ) ;
33
36
assertError ( { numberOfErrors, errorMessage } ) ;
34
37
cy . getCookies ( ) . should ( 'have.length' , 0 ) ;
@@ -306,7 +309,7 @@ describe('join', () => {
306
309
cy . findByLabelText ( inputFields . zipcode ) . type ( validUser . zipcode ) ;
307
310
cy . findByLabelText ( inputFields . codeOfConduct ) . type ( validUser . codeOfConduct ) ;
308
311
cy . findByLabelText ( inputFields . slackGuidelines ) . type ( validUser . slackGuidelines ) ;
309
- cy . findByText ( 'Submit' ) . click ( ) ;
312
+ cy . findByTestId ( REGISTRATION_FORM_INITIAL_SUBMIT_BUTTON ) . click ( ) ;
310
313
311
314
cy . url ( { timeout : 20000 } ) . should ( 'contain' , '/join/form' ) ;
312
315
cy . get ( 'h1' ) . should ( 'have.text' , 'Update Profile' ) ;
0 commit comments