Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed Nov 27, 2024
1 parent caba13d commit 0f0ac59
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ afterAll( () => {

jest.mock( '@wordpress/notices', () => {}, { virtual: true } );

jest.mock( '@automattic/jetpack-shared-extension-utils', () => ( {
__esModule: true,
...jest.requireActual( '@automattic/jetpack-shared-extension-utils' ),
useModuleStatus: jest.fn().mockReturnValue( {
isModuleActive: true,
isLoadingModules: false,
isChangingStatus: false,
changeStatus: jest.fn(),
} ),
} ) );

const setButtonBackgroundColor = jest.fn();
const setGradient = jest.fn();
const setTextColor = jest.fn();
Expand Down Expand Up @@ -74,13 +85,6 @@ beforeEach( () => {
} );

describe( 'Inspector controls', () => {
beforeEach( () => {
window.JetpackScriptData = {
social: {
urls: {},
},
};
} );
describe( 'Gradient settings panel', () => {
test( 'displays gradient settings control panel', () => {
render( <SubscriptionsInspectorControls { ...defaultProps } /> );
Expand Down

0 comments on commit 0f0ac59

Please sign in to comment.