Skip to content

Instantly share code, notes, and snippets.

@felipecesr
Created October 2, 2019 20:55
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 felipecesr/0bda9406edf1c9156604312c7347cc5e to your computer and use it in GitHub Desktop.
Save felipecesr/0bda9406edf1c9156604312c7347cc5e to your computer and use it in GitHub Desktop.
import React from 'react';
import ReactDOM from 'react-dom';
describe('Card', () => {
it('renders the user name', () => {
const user = { name: 'John Wick' };
const component = <Card user={user} />;
const container = document.createElement('div');
ReactDOM.render(component, container);
expect(container.textContent).toMatch('John Wick');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment