From 5a07b44f5c3740c4531e211e2b620b0a4996ce8f Mon Sep 17 00:00:00 2001 From: Timmy Crawford Date: Wed, 2 Dec 2020 17:13:36 -0800 Subject: [PATCH] Home Screen: Do not show store setup activity panel. (https://github.com/woocommerce/woocommerce-admin/pull/5801) Co-authored-by: Timmy Crawford --- .../client/header/activity-panel/index.js | 5 ++- .../header/activity-panel/test/index.js | 34 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce-admin/client/header/activity-panel/index.js b/plugins/woocommerce-admin/client/header/activity-panel/index.js index 890b8036327..f5bf139cfff 100644 --- a/plugins/woocommerce-admin/client/header/activity-panel/index.js +++ b/plugins/woocommerce-admin/client/header/activity-panel/index.js @@ -145,7 +145,10 @@ export class ActivityPanel extends Component { ! isEmbedded && this.isHomescreen() && ! isPerformingSetupTask; const showStoreSetup = - ! taskListComplete && ! taskListHidden && ! isPerformingSetupTask; + ! taskListComplete && + ! taskListHidden && + ! isPerformingSetupTask && + ( ! this.isHomescreen() || isEmbedded ); const inbox = showInbox ? { diff --git a/plugins/woocommerce-admin/client/header/activity-panel/test/index.js b/plugins/woocommerce-admin/client/header/activity-panel/test/index.js index 5523f41880a..62b8e0f42ad 100644 --- a/plugins/woocommerce-admin/client/header/activity-panel/test/index.js +++ b/plugins/woocommerce-admin/client/header/activity-panel/test/index.js @@ -159,4 +159,38 @@ describe( 'Activity Panel', () => { expect( queryByText( 'Store Setup' ) ).toBeNull(); } ); + + it( 'should not render the store setup link when on the home screen and TaskList is not complete', () => { + const { queryByText } = render( + ( { + location: { + pathname: '/', + }, + } ) } + query={ { + task: '', + } } + /> + ); + + expect( queryByText( 'Store Setup' ) ).toBeNull(); + } ); + + it( 'should render the store setup link when on embedded pages and TaskList is not complete', () => { + const { queryByText } = render( + + ); + + expect( queryByText( 'Store Setup' ) ).toBeDefined(); + } ); } );