diff --git a/test/components/flag.spec.js b/test/components/flag.spec.js new file mode 100644 index 000000000..4be00c219 --- /dev/null +++ b/test/components/flag.spec.js @@ -0,0 +1,23 @@ +import {expect} from 'chai' +import {render} from 'enzyme' +import React from 'react' + +import Flag from '../../app/scripts/components/flag' + +describe('flag', () => { + it('should render country and flag', () => { + const country = 'country' + const el = render() + + expect(el.find('.flag-icon.flag-icon-country.flag-icon-squared').length) + .to.equal(1) + }) + + it('should not render flag unless specified', () => { + const country = 'country' + const el = render() + + expect(el.find('.flag-icon.flag-icon-country.flag-icon-squared').length) + .to.equal(0) + }) +})