From 18c94c4ac9a2e6981bb9dedc49b7351582153707 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Fri, 31 Aug 2018 12:30:16 -0700 Subject: Add tests for Card component --- .../components/card/tests/card.component.test.js | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 ui/app/components/card/tests/card.component.test.js (limited to 'ui/app/components/card/tests') diff --git a/ui/app/components/card/tests/card.component.test.js b/ui/app/components/card/tests/card.component.test.js new file mode 100644 index 000000000..cea05033f --- /dev/null +++ b/ui/app/components/card/tests/card.component.test.js @@ -0,0 +1,25 @@ +import React from 'react' +import assert from 'assert' +import { shallow } from 'enzyme' +import Card from '../card.component' + +describe('Card Component', () => { + it('should render a card with a title and child element', () => { + const wrapper = shallow( + +
Child
+
+ ) + + assert.ok(wrapper.hasClass('card-test-class')) + const title = wrapper.find('.card__title') + assert.ok(title) + assert.equal(title.text(), 'Test') + const child = wrapper.find('.child-test-class') + assert.ok(child) + assert.equal(child.text(), 'Child') + }) +}) -- cgit