Created
February 27, 2019 21:40
-
-
Save iainnash/04a64aa3d0b9b11d0f97747ac457f4e8 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 ShallowRenderer from 'react-test-renderer/shallow'; | |
import {TodayIntro} from './TodayIntro'; | |
describe('TodayIntro', () => { | |
it('should render a hello message with a date', () => { | |
MockDate.set('2018-01-01'); | |
const renderer = new ShallowRenderer(); | |
renderer.render(<TodayIntro name="test" />); | |
const result = renderer.getRenderOutput(); | |
expect(result.type).toBe('h1'); | |
expect(result.children).toBe(['hello test, today is Jan 1']); | |
MockDate.reset(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment