Last active
June 6, 2018 08:13
-
-
Save ollelauribostrom/938a755cb3407b79918e8a53262d053b to your computer and use it in GitHub Desktop.
This file contains hidden or 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 * as React from 'react'; | |
import { shallow } from 'enzyme'; | |
import { Box } from './Box'; | |
describe('Tests for Box component', () => { | |
it('should render', () => { | |
const box = shallow(<Box />); | |
expect(box.find('.box').exists()).toEqual(true); | |
}); | |
it('should apply custom class name if provided', () => { | |
const box = shallow(<Box customClassName='custom-red-box' />); | |
expect(box.hasClass('custom-red-box')).toEqual(true); | |
}); | |
it('should apply label if provided', () => { | |
const box = shallow(<Box label='Red' />); | |
expect(box.text()).toEqual('Red'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment