Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielcaires committed Sep 24, 2024
1 parent c520eff commit 55e1bc4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ const Form: FC< FormProps > = ( { onComplete } ) => {

useEffect( () => {
if ( isSuccess ) {
alert( 'Success!' );
if ( process.env.NODE_ENV !== 'development' ) {
alert( 'Success!' );
}
onComplete();
}
}, [ isSuccess, onComplete ] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ describe( 'SiteMigrationAlreadyWordPress', () => {
render( { navigation: { submit } }, { initialEntry: '/some-path?from=https://example.com' } );

await userEvent.click( continueButton() );
expect( await screen.findByText( 'Please select an option' ) ).toBeVisible();
expect( await screen.findByText( /Please select an option/ ) ).toBeVisible();
} );

it( 'shows an error when the user selects other but does not provide details', async () => {
render( {}, { initialEntry: '/some-path?from=https://example.com' } );
userEvent.click( intentByName( 'Other' ) );
await userEvent.click( continueButton() );

expect( await screen.findByText( 'Please describe your needs' ) ).toBeVisible();
expect( await screen.findByText( /Please, provide more details/ ) ).toBeVisible();
} );

it( 'navigate to next step when the submits an intent', async () => {
Expand Down

0 comments on commit 55e1bc4

Please sign in to comment.