Skip to content

Instantly share code, notes, and snippets.

@Ron-Lavi
Created October 23, 2019 12:14
Show Gist options
  • Save Ron-Lavi/0d35708e02f65feec2680d96a54876de to your computer and use it in GitHub Desktop.
Save Ron-Lavi/0d35708e02f65feec2680d96a54876de to your computer and use it in GitHub Desktop.
jest.mock('../../redux/API');
const combinedReducers = { notifications: notificationReducer, ...APIReducers };
const middlewares = [APIMiddleware]
const failResponse = { response: { status: 401 } };
const notificationProps = {
data: componentMountData,
};
describe('Notification integration test', () => {
it('should flow', () => {
API.get.mockImplementation(() => serverResponse);
const integrationTestHelper = new IntegrationTestHelper(combinedReducers, middlewares);
integrationTestHelper.mount(
<Notifications {...notificationProps} />
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment