Skip to content

Instantly share code, notes, and snippets.

@aaronkelton
Created September 9, 2019 01:06
Show Gist options
  • Save aaronkelton/754ce171c22e60e6aa73dc14644d868d to your computer and use it in GitHub Desktop.
Save aaronkelton/754ce171c22e60e6aa73dc14644d868d to your computer and use it in GitHub Desktop.
import React from 'react'
import { shallow } from 'enzyme'
import HelloReact from 'packs/hello_react'
describe('HelloReact component', () => {
describe('when a name is given as a prop', () => {
it('renders Hello Aaron!', () => {
expect(shallow(<HelloReact name="Aaron" />).text()).toBe('Hello Aaron!')
})
})
describe('when no name is given', () => {
it('renders Hello David!', () => {
expect(shallow(<HelloReact />).text()).toBe('Hello David!')
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment