11import existingUser from 'test-utils/mocks/existingUser' ;
22import { mockUser } from 'test-utils/mockGenerators/mockUser' ;
33import { 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' ;
58
69const getValidUser = ( ) => mockUser ( ) ;
710const inputFields = {
@@ -28,7 +31,7 @@ const assertFailedLogin = ({
2831 numberOfErrors = 1 ,
2932 errorMessage = validationErrorMessages . required ,
3033} = { } ) => {
31- cy . findByText ( 'Submit' ) . click ( ) ;
34+ cy . findByTestId ( REGISTRATION_FORM_INITIAL_SUBMIT_BUTTON ) . click ( ) ;
3235 cy . url ( ) . should ( 'contain' , '/join' ) ;
3336 assertError ( { numberOfErrors, errorMessage } ) ;
3437 cy . getCookies ( ) . should ( 'have.length' , 0 ) ;
@@ -306,7 +309,7 @@ describe('join', () => {
306309 cy . findByLabelText ( inputFields . zipcode ) . type ( validUser . zipcode ) ;
307310 cy . findByLabelText ( inputFields . codeOfConduct ) . type ( validUser . codeOfConduct ) ;
308311 cy . findByLabelText ( inputFields . slackGuidelines ) . type ( validUser . slackGuidelines ) ;
309- cy . findByText ( 'Submit' ) . click ( ) ;
312+ cy . findByTestId ( REGISTRATION_FORM_INITIAL_SUBMIT_BUTTON ) . click ( ) ;
310313
311314 cy . url ( { timeout : 20000 } ) . should ( 'contain' , '/join/form' ) ;
312315 cy . get ( 'h1' ) . should ( 'have.text' , 'Update Profile' ) ;
0 commit comments