Last active
June 6, 2018 08:14
-
-
Save ollelauribostrom/7f59661df670ec9fde8d110d924a2a1a 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')).toExist(); | |
}); | |
it('should apply custom class name if provided', () => { | |
const box = shallow(<Box customClassName='custom-red-box' />); | |
expect(box).toHaveClassName('custom-red-box'); | |
}); | |
it('should apply label if provided', () => { | |
const box = shallow(<Box label='Red' />); | |
expect(box).toHaveText('Red'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment