Skip to content

Commit 54cd414

Browse files
committed
Address CR feedback.
1 parent 00d55fe commit 54cd414

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

assets/js/components/setup/ModuleSetup.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ export default function ModuleSetup( { moduleSlug } ) {
5555
const setupFlowRefreshEnabled = useFeature( 'setupFlowRefresh' );
5656
const [ showProgress ] = useQueryArg( 'showProgress' );
5757

58+
const isInitialSetupFlow =
59+
setupFlowRefreshEnabled &&
60+
moduleSlug === MODULE_SLUG_ANALYTICS_4 &&
61+
showProgress === 'true';
62+
5863
const module = useSelect( ( select ) =>
5964
select( CORE_MODULES ).getModule( moduleSlug )
6065
);
@@ -97,7 +102,7 @@ export default function ModuleSetup( { moduleSlug } ) {
97102
);
98103
navigateTo( adminURL );
99104
},
100-
[ registry, navigateTo, moduleSlug ]
105+
[ registry, navigateTo, moduleSlug, viewContext, isInitialSetupFlow ]
101106
);
102107

103108
const onCompleteSetup = module?.onCompleteSetup;
@@ -110,11 +115,6 @@ export default function ModuleSetup( { moduleSlug } ) {
110115
await trackEvent( 'moduleSetup', 'cancel_module_setup', moduleSlug );
111116
}, [ moduleSlug ] );
112117

113-
const isInitialSetupFlow =
114-
setupFlowRefreshEnabled &&
115-
moduleSlug === MODULE_SLUG_ANALYTICS_4 &&
116-
showProgress === 'true';
117-
118118
useMount( () => {
119119
if ( isInitialSetupFlow ) {
120120
trackEvent(

assets/js/modules/analytics-4/components/common/AccountCreate/index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ describe( 'AccountCreate', () => {
325325
cleanup();
326326
} );
327327

328-
it( 'should track initial setup flow create account event when showProgress=true', async () => {
328+
it( 'should track create account event during initial setup flow', async () => {
329329
global.location.href =
330330
'http://example.com/wp-admin/admin.php?page=googlesitekit-dashboard&slug=analytics-4&reAuth=true&showProgress=true';
331331

@@ -357,7 +357,7 @@ describe( 'AccountCreate', () => {
357357
expect( genericCreateAccountCall ).toBeUndefined();
358358
} );
359359

360-
it( 'should track generic create account event when showProgress is not true', async () => {
360+
it( 'should track generic create account event during non-initial setup flow', async () => {
361361
global.location.href =
362362
'http://example.com/wp-admin/admin.php?page=googlesitekit-dashboard&slug=analytics-4&reAuth=true';
363363
( { getByRole, waitForRegistry, rerender } = render(

0 commit comments

Comments
 (0)