From da0df790472c816d933e9b697e4dab1a429740a3 Mon Sep 17 00:00:00 2001 From: Alexander Tseung Date: Wed, 15 Aug 2018 19:18:01 -0700 Subject: Add CurrencyDisplay and TokenCurrencyDisplay components --- .../tests/currency-display.component.test.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ui/app/components/currency-display/tests/currency-display.component.test.js (limited to 'ui/app/components/currency-display/tests/currency-display.component.test.js') diff --git a/ui/app/components/currency-display/tests/currency-display.component.test.js b/ui/app/components/currency-display/tests/currency-display.component.test.js new file mode 100644 index 000000000..d9ef052f1 --- /dev/null +++ b/ui/app/components/currency-display/tests/currency-display.component.test.js @@ -0,0 +1,27 @@ +import React from 'react' +import assert from 'assert' +import { shallow } from 'enzyme' +import CurrencyDisplay from '../currency-display.component' + +describe('CurrencyDisplay Component', () => { + it('should render text with a className', () => { + const wrapper = shallow() + + assert.ok(wrapper.hasClass('currency-display')) + assert.equal(wrapper.text(), '$123.45') + }) + + it('should render text with a prefix', () => { + const wrapper = shallow() + + assert.ok(wrapper.hasClass('currency-display')) + assert.equal(wrapper.text(), '-$123.45') + }) +}) -- cgit