Home Screen: Do not show store setup activity panel. (https://github.com/woocommerce/woocommerce-admin/pull/5801)

Co-authored-by: Timmy Crawford <timmyc@churro.lan>
This commit is contained in:
Timmy Crawford 2020-12-02 17:13:36 -08:00 committed by GitHub
parent 82ae70e910
commit 5a07b44f5c
2 changed files with 38 additions and 1 deletions

View File

@ -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
? {

View File

@ -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(
<ActivityPanel
requestingTaskListOptions={ false }
taskListComplete={ false }
taskListHidden={ false }
getHistory={ () => ( {
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(
<ActivityPanel
requestingTaskListOptions={ false }
taskListComplete={ false }
taskListHidden={ false }
isEmbedded
query={ {} }
/>
);
expect( queryByText( 'Store Setup' ) ).toBeDefined();
} );
} );