From d4a2e15fd262f5c738e3823cdb157411897da592 Mon Sep 17 00:00:00 2001 From: David Mai Date: Fri, 26 Feb 2016 00:47:20 -0800 Subject: [PATCH] flag spec --- test/components/flag.spec.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/components/flag.spec.js 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) + }) +})