Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nightnei committed Nov 13, 2024
1 parent 2900014 commit 6ed28ae
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/hooks/tests/use-site-sync-management.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jest.mock( '../../lib/get-ipc-api', () => ( {
getConnectedWpcomSites: jest.fn().mockResolvedValue( mockConnectedWpcomSites ),
connectWpcomSite: connectWpcomSiteMock,
disconnectWpcomSite: disconnectWpcomSiteMock,
updateConnectedWpcomSites: jest.fn(),
} ),
} ) );

Expand All @@ -76,7 +77,7 @@ describe( 'useSiteSyncManagement', () => {
} );

afterEach( () => {
jest.resetAllMocks();
jest.clearAllMocks();
} );

it( 'loads connected sites on mount when authenticated', async () => {
Expand Down
1 change: 1 addition & 0 deletions src/hooks/use-site-sync-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export const useSiteSyncManagement = () => {
sitesToDisconnect,
localSiteId
);

setConnectedSites( newDisconnectedSites );
} catch ( error ) {
console.error( 'Failed to disconnect site:', error );
Expand Down
2 changes: 1 addition & 1 deletion src/ipc-handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ export async function disconnectWpcomSite(
event: IpcMainInvokeEvent,
siteIds: number[],
localSiteId: string
): Promise< SyncSite[] > {
) {
const userData = await loadUserData();
const currentUserId = userData.authToken?.id;

Expand Down

0 comments on commit 6ed28ae

Please sign in to comment.