import storeService from "../src/services/redux-store.service";
// Mock mapStateToProps and mapDispatchToProps from the store service, so the actual implementations are never used during testing
export const mockStoreService = () => {
    beforeEach(() => {
        jest.spyOn(storeService, 'mapStateToProps').mockImplementation(() => {
            return jest.fn(); // return mock unsubscribe function
        });
        jest.spyOn(storeService, 'mapDispatchToProps').mockImplementation((component, props) => {
            Object.keys(props).forEach((key) => {
                component[key] = jest.fn();
            });
        });
    });
    // TODO: Uncomment this, fix whatever tests are failing because of it
    // afterEach(() => {
    //   jest.resetAllMocks();
    // });
    afterAll(() => {
        jest.restoreAllMocks();
    });
};
