Skip to content

Instantly share code, notes, and snippets.

@marta-pinkowska
Last active September 27, 2022 14:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marta-pinkowska/3ec5f99e31331926859d0cb2661dc59b to your computer and use it in GitHub Desktop.
Save marta-pinkowska/3ec5f99e31331926859d0cb2661dc59b to your computer and use it in GitHub Desktop.
// src/FancyHomepageFeature/__tests__/FancyHomePage.test.js
import { FancyHomePage } from "../FancyHomePage";
import {
setupHomeHandlers,
setupFaultyHomeHandlers,
setupFailedHomeHandlers,
} from "./msw/mswHandlers";
describe("<FancyHomePage />", () => {
beforeEach(() => setupHomeHandlers());
test("displays homepage data", async () => {
// Render homepage with backend data
});
});
describe("<FancyHomePage /> - faulty data", () => {
beforeEach(() => setupFaultyHomeHandlers());
test("displays readable error when receiving unexpected data", async () => {
// Render homepage with error information
});
});
describe("<FancyHomePage /> - network error", () => {
beforeEach(() => setupFailedHomeHandlers());
test("displays network error", async () => {
// Render homepage with network error information
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment