Skip to content

Commit 6576668

Browse files
anomiexmatticbot
authored andcommitted
publicize-components: Fix tests (#42063)
PR #41951 added some new tests, with a bunch of mocking. Meanwhile PRs #42019 and #41859 added new calls that need to be mocked. Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/13546652359 Upstream-Ref: Automattic/jetpack@544eb68
1 parent bc0e1dc commit 6576668

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils/test-mocks.js

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jest.mock( '@automattic/jetpack-script-data', () => ( {
2222
isSimpleSite: jest.fn(),
2323
siteHasFeature: jest.fn(),
2424
getMyJetpackUrl: jest.fn( () => 'https://example.com/add-license' ),
25+
currentUserCan: jest.fn( () => true ),
2526
} ) );
2627

2728
jest.mock( '@wordpress/editor', () => ( {
@@ -66,6 +67,10 @@ jest.mock( './', () => ( {
6667
hasSocialPaidFeatures: jest.fn( () => false ),
6768
} ) );
6869

70+
jest.mock( '../social-store/hydrate-stores.ts', () => ( {
71+
hydrateStores: jest.fn(),
72+
} ) );
73+
6974
// Store
7075
const defaultStore = {
7176
getSocialModuleSettings: () => ( { publicize: true } ),

0 commit comments

Comments
 (0)