Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejs
expect(screen.getByText(/My hovercraft is full of eels/i)).toBeInTheDocument();
expect(screen.getByRole('button', { name: /add_potato/ })).toBeDisabled();

...

Expecting that an event is emitted

Code Block
languagejs
const view = render(MyComponent);
await fireEvent.click(view.getByRole('button', { name: /remove_potato/ }));
expect(view.emitted('do_thing')).toEqual({ 'do_thing': [[123]] });

Mocking GraphQL queries

...