insomnia/packages/insomnia-app/app/__jest__/redux-state-for-test.ts

18 lines
572 B
TypeScript

import { ACTIVITY_DEBUG } from '../common/constants';
import { RootState } from '../ui/redux/modules';
import * as entities from '../ui/redux/modules/entities';
const reduxStateForTest = async (activeWorkspaceId: string): Promise<RootState> => ({
entities: entities.reducer(entities.initialEntitiesState, entities.initializeWith(await entities.allDocs())),
global: {
activeWorkspaceId,
activeActivity: ACTIVITY_DEBUG,
activeSpaceId: null,
isLoading: false,
isLoggedIn: false,
loadingRequestIds: {},
},
});
export default reduxStateForTest;