Update /utils/utils.ts

- Remove irrelevant functionality
- Relevant updates in spec file
This commit is contained in:
Misha Utkin 2025-02-06 11:47:31 +01:00
parent 8334352104
commit 965744ef9f
No known key found for this signature in database
GPG key ID: 0675AD83BAE10581
2 changed files with 4 additions and 15 deletions

View file

@ -20,7 +20,6 @@ const percyConfig: PercyConfig = {
test.beforeAll( async ( { utils } ) => { test.beforeAll( async ( { utils } ) => {
await utils.configureStore( storeConfigDefault ); await utils.configureStore( storeConfigDefault );
await utils.configurePcp( { await utils.configurePcp( {
clearPCPDB: true,
disconnectMerchant: true, disconnectMerchant: true,
} ); } );
} ); } );

View file

@ -24,7 +24,7 @@ import {
subscriptionsPlugin, subscriptionsPlugin,
wpDebuggingPlugin, wpDebuggingPlugin,
pcpPlugin, pcpPlugin,
PcpMerchant, Pcp,
} from '../resources'; } from '../resources';
import { getCustomerStorageStateName } from './helpers'; import { getCustomerStorageStateName } from './helpers';
@ -151,12 +151,7 @@ export class Utils {
); );
}; };
connectMerchant = async ( connectMerchant = async ( merchant: Pcp.Merchant ) => {};
merchant: PcpMerchant,
options = {
enablePayUponInvoice: false,
}
) => {};
disconnectMerchant = async () => {}; disconnectMerchant = async () => {};
@ -242,7 +237,7 @@ export class Utils {
} }
}; };
configurePcp = async ( data ) => { configurePcp = async ( data: Pcp.Admin.Config ) => {
if ( if (
! ( await this.requestUtils.isPluginInstalled( pcpPlugin.slug ) ) ! ( await this.requestUtils.isPluginInstalled( pcpPlugin.slug ) )
) { ) {
@ -251,17 +246,12 @@ export class Utils {
await this.requestUtils.activatePlugin( pcpPlugin.slug ); await this.requestUtils.activatePlugin( pcpPlugin.slug );
if ( data.merchant ) { if ( data.merchant ) {
if ( data.clearPCPDB ) {
}
if ( data.disconnectMerchant ) { if ( data.disconnectMerchant ) {
await this.disconnectMerchant(); await this.disconnectMerchant();
return; return;
} }
await this.connectMerchant( data.merchant, { await this.connectMerchant( data.merchant );
enablePayUponInvoice: data.enablePayUponInvoice || false,
} );
} }
}; };
} }