Add tasklist_view_more_product_types_click track event for add product task
This commit is contained in:
parent
c6d198723f
commit
2520781c7e
|
@ -12,6 +12,7 @@ import { useMemo, useState } from '@wordpress/element';
|
|||
import { Button, Spinner } from '@wordpress/components';
|
||||
import { getAdminLink } from '@woocommerce/settings';
|
||||
import { Icon, chevronDown, chevronUp } from '@wordpress/icons';
|
||||
import { recordEvent } from '@woocommerce/tracks';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
|
@ -147,7 +148,14 @@ export const Products = () => {
|
|||
) }
|
||||
<ViewControlButton
|
||||
isExpanded={ isExpanded }
|
||||
onClick={ () => setIsExpanded( ! isExpanded ) }
|
||||
onClick={ () => {
|
||||
if ( ! isExpanded ) {
|
||||
recordEvent(
|
||||
'tasklist_view_more_product_types_click'
|
||||
);
|
||||
}
|
||||
setIsExpanded( ! isExpanded );
|
||||
} }
|
||||
/>
|
||||
<Footer />
|
||||
</div>
|
||||
|
|
|
@ -128,11 +128,15 @@ describe( 'Products', () => {
|
|||
|
||||
expect( recordEvent ).toHaveBeenNthCalledWith(
|
||||
1,
|
||||
'tasklist_view_more_product_types_click'
|
||||
);
|
||||
expect( recordEvent ).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
'tasklist_product_template_selection',
|
||||
{ is_suggested: false, product_type: 'grouped' }
|
||||
);
|
||||
expect( recordEvent ).toHaveBeenNthCalledWith(
|
||||
2,
|
||||
3,
|
||||
'task_completion_time',
|
||||
{ task_name: 'products', time: '0-2s' }
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue