From 55e1bc4a18b17298b36c541830135cac57937954 Mon Sep 17 00:00:00 2001 From: Gabriel Caires Date: Tue, 24 Sep 2024 16:51:40 +0100 Subject: [PATCH] Fix tests --- .../components/form/index.tsx | 4 +++- .../site-migration-already-wordpress/test/index.tsx | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-already-wordpress/components/form/index.tsx b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-already-wordpress/components/form/index.tsx index 2dc3f1aa049c74..ddcad2a359cb96 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-already-wordpress/components/form/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-already-wordpress/components/form/index.tsx @@ -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 ] ); diff --git a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-already-wordpress/test/index.tsx b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-already-wordpress/test/index.tsx index fbdf0c8b709c7f..9d3176752eb482 100644 --- a/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-already-wordpress/test/index.tsx +++ b/client/landing/stepper/declarative-flow/internals/steps-repository/site-migration-already-wordpress/test/index.tsx @@ -28,7 +28,7 @@ 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 () => { @@ -36,7 +36,7 @@ describe( 'SiteMigrationAlreadyWordPress', () => { 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 () => {