Skip to content

Instantly share code, notes, and snippets.

@trooperandz
Last active August 14, 2022 16:53
Show Gist options
  • Save trooperandz/45694db8dd929d92b249e0e5546dc1d0 to your computer and use it in GitHub Desktop.
Save trooperandz/45694db8dd929d92b249e0e5546dc1d0 to your computer and use it in GitHub Desktop.
Testing philosophies user test example
describe("UserTest", () => {
it("Handles the shipment card press event", () => {
const { getByTestId } = renderComponent();
fireEvent.press(getByTestId(SHIPMENT_CARD));
expect(mockPressHandler).toHaveBeenCalled();
});
it("Renders the shipment number", async () => {
const { getByText } = renderComponent();
expect(getByText(SHIPMENT_NUMBER)).toBeDefined();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment