Fix failed test for Campaigns component.

This commit is contained in:
Gan Eng Chin 2023-03-09 01:08:28 +08:00
parent 66e46d8942
commit 6d72c2bbe1
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
1 changed files with 9 additions and 3 deletions

View File

@ -19,9 +19,15 @@ jest.mock( '~/marketing/hooks', () => ( {
useNewCampaignTypes: jest.fn(),
} ) );
jest.mock( './CreateNewCampaignModal', () => ( {
CreateNewCampaignModal: () => <div>Create a new campaign</div>,
} ) );
jest.mock( '~/marketing/components', () => {
const originalModule = jest.requireActual( '~/marketing/components' );
return {
__esModule: true,
...originalModule,
CreateNewCampaignModal: () => <div>Create a new campaign</div>,
};
} );
/**
* Create a test campaign data object.