Created
October 2, 2019 21:20
-
-
Save felipecesr/79b5f654ec3fb4ae7302e9d7fdd2d4c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Card } from '../src/Card'; | |
describe('Card', () => { | |
let container; | |
let user; | |
beforeEach(() => { | |
container = document.createElement('div'); | |
}); | |
const render = component => ReactDOM.render(component, container); | |
it('renders the user name', () => { | |
user = { name: 'John Wick' }; | |
render(<Card user={user} />); | |
expect(container.textContent).toMatch('John Wick'); | |
}); | |
it('renders another user name', () => { | |
user = { name: 'Steve Rogers' }; | |
render(<Card user={user} />); | |
expect(container.textContent).toMatch('Steve Rogers'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment