Skip to content

Instantly share code, notes, and snippets.

@khalidwilliams
Created August 21, 2020 14:52
Show Gist options
  • Save khalidwilliams/d974e33e36fadb3c34010257e0036ea7 to your computer and use it in GitHub Desktop.
Save khalidwilliams/d974e33e36fadb3c34010257e0036ea7 to your computer and use it in GitHub Desktop.

In your pairs, walk through each line and explain what is happening.

  it('should have the correct content when rendered', () => {
    render(<Card
      title="Feed the birds"
      description="Tuppence a bag"
      id={1}
      removeIdea={jest.fn()}
    />);


    const title = screen.getByText("Feed the birds");
    const description = screen.getByText("Tuppence a bag");
    const button = screen.getByRole("button");

    expect(title).toBeInTheDocument();
    expect(description).toBeInTheDocument();
    expect(button).toBeInTheDocument();

  });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment