Skip to content

Commit

Permalink
Make tests for rendering a list of choices
Browse files Browse the repository at this point in the history
  • Loading branch information
chuck-sys committed Feb 3, 2020
1 parent 39cd12c commit a632c2a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/components/choices/Choices.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import "@testing-library/jest-dom/extend-expect";
import React from "react";
import {render} from "@testing-library/react";
import Choices from "./Choices";
import BoomerGregorEvent from "../../events/BoomerGregorEvent";

it("renders choices correctly", () => {
const choices = new BoomerGregorEvent().choices();
const {getByText} = render(
<Choices
choices={choices}
makeChoice={(c) => {c}}
/>);
for (const c of choices) {
expect(getByText(c.answer())).toBeInTheDocument();
}
});

0 comments on commit a632c2a

Please sign in to comment.