Commit e599d0f7d8 for woocommerce
commit e599d0f7d88fc917a2890979f10cffba2005727c
Author: Eric Binnion <ericbinnion@gmail.com>
Date: Wed Feb 18 08:43:00 2026 -0600
Onboarding: Add US/Chile shipping onboarding coverage (#63348)
* Add US/Chile shipping onboarding coverage
* Add changelog
* test: restore shipping task e2e teardown state
* test: replace shipping CTA e2e checks with unit coverage
diff --git a/plugins/woocommerce/changelog/fix-shipping-onboarding-extension-actions b/plugins/woocommerce/changelog/fix-shipping-onboarding-extension-actions
new file mode 100644
index 0000000000..01c87e24bd
--- /dev/null
+++ b/plugins/woocommerce/changelog/fix-shipping-onboarding-extension-actions
@@ -0,0 +1,4 @@
+Significance: patch
+Type: fix
+
+Fixes issue where actions for shipping extension in onboarding didn't display.
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/index.js b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/index.js
index 65f357757b..d7d78e2a09 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/index.js
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/index.js
@@ -40,6 +40,10 @@ import {
import { TermsOfService } from '~/task-lists/components/terms-of-service';
import { TrackedLink } from '~/components/tracked-link/tracked-link';
+export const hasInstallableSlug = ( shippingMethod ) =>
+ typeof shippingMethod?.slug === 'string' &&
+ shippingMethod.slug.trim().length > 0;
+
export class Shipping extends Component {
constructor( props ) {
super( props );
@@ -206,9 +210,11 @@ export class Shipping extends Component {
} = this.props;
const pluginsToPromote = shippingPartners;
- const pluginsToActivate = pluginsToPromote.map( ( pluginToPromote ) => {
- return pluginToPromote.slug;
- } );
+ const pluginsToActivate = pluginsToPromote
+ .map( ( pluginToPromote ) => pluginToPromote.slug )
+ .filter(
+ ( slug ) => typeof slug === 'string' && slug.trim().length > 0
+ );
const onShippingPluginInstalltionSkip = () => {
recordEvent( 'tasklist_shipping_label_printing', {
@@ -372,7 +378,7 @@ export class Shipping extends Component {
/>
</>
),
- visible: pluginsToActivate.length,
+ visible: pluginsToPromote.length,
},
// Only needed for WooCommerce Shipping
@@ -526,7 +532,9 @@ export class Shipping extends Component {
</div>
) }
{ pluginsToPromote.length === 1 &&
- pluginsToPromote[ 0 ].slug === undefined && ( // if it doesn't have a slug we just show a download button
+ ! hasInstallableSlug(
+ pluginsToPromote[ 0 ]
+ ) && ( // if it doesn't have a slug we just show a download button
<a
href={
pluginsToPromote[ 0 ]
@@ -541,7 +549,7 @@ export class Shipping extends Component {
</a>
) }
{ pluginsToPromote.length === 1 &&
- pluginsToPromote[ 0 ].slug ? (
+ hasInstallableSlug( pluginsToPromote[ 0 ] ) ? (
<>
{ ! isJetpackConnected &&
pluginsToPromote[ 0 ].slug ===
diff --git a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/test/index.tsx b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/test/index.tsx
index 4ea2b24d24..5ebfcb82a1 100644
--- a/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/test/index.tsx
+++ b/plugins/woocommerce/client/admin/client/task-lists/fills/shipping/test/index.tsx
@@ -8,7 +8,7 @@ import { TaskType } from '@woocommerce/data';
/**
* Internal dependencies
*/
-import { Shipping } from '../index';
+import { Shipping, hasInstallableSlug } from '../index';
jest.mock( '@woocommerce/tracks', () => ( {
recordEvent: jest.fn(),
@@ -41,6 +41,18 @@ describe( 'Shipping', () => {
task: { id: 'shipping' } as TaskType,
};
+ const usShippingPartner = {
+ id: 'woocommerce-shipping',
+ name: 'WooCommerce Shipping',
+ slug: 'woocommerce-shipping',
+ };
+
+ const chileShippingPartner = {
+ id: 'envia',
+ name: 'Envia',
+ slug: '',
+ };
+
it( 'should trigger event tasklist_shipping_visit_marketplace_click when clicking the WooCommerce Marketplace link', () => {
render( <Shipping { ...props } /> );
@@ -73,4 +85,16 @@ describe( 'Shipping', () => {
'admin.php?page=wc-admin&tab=extensions&path=/extensions&category=shipping'
);
} );
+
+ it( 'treats US shipping partners with slugs as installable', () => {
+ expect( hasInstallableSlug( usShippingPartner ) ).toBe( true );
+ } );
+
+ it( 'treats Chile shipping partners without slugs as non-installable', () => {
+ expect( hasInstallableSlug( chileShippingPartner ) ).toBe( false );
+ } );
+
+ it( 'treats missing slugs as non-installable partners', () => {
+ expect( hasInstallableSlug( {} ) ).toBe( false );
+ } );
} );