/**
* @jest-environment jsdom
*/
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { render, waitFor } from '@testing-library/react';
import React, { useEffect } from 'react';
import { EmailDeliveryFrequency } from '../../constants';
import { callApi } from '../../helpers';
import useSiteDeliveryFrequencyMutation from '../../mutations/use-site-delivery-frequency-mutation';
// Mock the useIsLoggedIn function
jest.mock( '../../hooks', () => ( {
useIsLoggedIn: jest.fn().mockReturnValue( { isLoggedIn: true } ),
useCacheKey: jest.fn(),
} ) );
// Mock the entire Helpers module
jest.mock( '../../helpers', () => ( {
callApi: jest.fn(),
applyCallbackToPages: jest.fn(),
buildQueryKey: jest.fn(),
} ) );
const client = new QueryClient();
const Parent = ( { children } ) => (