diff options
author | Chi Kei Chan <chikeichan@gmail.com> | 2019-03-22 07:03:30 +0800 |
---|---|---|
committer | Dan J Miller <danjm.com@gmail.com> | 2019-03-22 07:03:30 +0800 |
commit | 31175625b446cb5d18b17db23018bca8b14d280c (patch) | |
tree | f54e159883deef003fb281267025edf796eb8004 /ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js | |
parent | 7287133e15fab22299e07704206e85bc855d1064 (diff) | |
download | tangerine-wallet-browser-31175625b446cb5d18b17db23018bca8b14d280c.tar.gz tangerine-wallet-browser-31175625b446cb5d18b17db23018bca8b14d280c.tar.zst tangerine-wallet-browser-31175625b446cb5d18b17db23018bca8b14d280c.zip |
Folder restructure (#6304)
* Remove ui/app/keychains/
* Remove ui/app/img/ (unused images)
* Move conversion-util to helpers/utils/
* Move token-util to helpers/utils/
* Move /helpers/*.js inside /helpers/utils/
* Move util tests inside /helpers/utils/
* Renameand move confirm-transaction/util.js to helpers/utils/
* Move higher-order-components to helpers/higher-order-components/
* Move infura-conversion.json to helpers/constants/
* Move all utility functions to helpers/utils/
* Move pages directory to top-level
* Move all constants to helpers/constants/
* Move metametrics inside helpers/
* Move app and root inside pages/
* Move routes inside helpers/
* Re-organize ducks/
* Move reducers to ducks/
* Move selectors inside selectors/
* Move test out of test folder
* Move action, reducer, store inside store/
* Move ui components inside ui/
* Move UI components inside ui/
* Move connected components inside components/app/
* Move i18n-helper inside helpers/
* Fix unit tests
* Fix unit test
* Move pages components
* Rename routes component
* Move reducers to ducks/index
* Fix bad path in unit test
Diffstat (limited to 'ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js')
-rw-r--r-- | ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js b/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js deleted file mode 100644 index 08f26854e..000000000 --- a/ui/app/components/send/send-content/send-gas-row/tests/send-gas-row-component.test.js +++ /dev/null @@ -1,104 +0,0 @@ -import React from 'react' -import assert from 'assert' -import { shallow } from 'enzyme' -import sinon from 'sinon' -import SendGasRow from '../send-gas-row.component.js' - -import SendRowWrapper from '../../send-row-wrapper/send-row-wrapper.component' -import GasFeeDisplay from '../gas-fee-display/gas-fee-display.component' -import GasPriceButtonGroup from '../../../../gas-customization/gas-price-button-group' - -const propsMethodSpies = { - showCustomizeGasModal: sinon.spy(), - resetGasButtons: sinon.spy(), -} - -describe('SendGasRow Component', function () { - let wrapper - - beforeEach(() => { - wrapper = shallow(<SendGasRow - conversionRate={20} - convertedCurrency={'mockConvertedCurrency'} - gasFeeError={'mockGasFeeError'} - gasLoadingError={false} - gasTotal={'mockGasTotal'} - gasButtonGroupShown={false} - showCustomizeGasModal={propsMethodSpies.showCustomizeGasModal} - resetGasButtons={propsMethodSpies.resetGasButtons} - gasPriceButtonGroupProps={{ - someGasPriceButtonGroupProp: 'foo', - anotherGasPriceButtonGroupProp: 'bar', - }} - />, { context: { t: str => str + '_t', metricsEvent: () => ({}) } }) - }) - - afterEach(() => { - propsMethodSpies.resetGasButtons.resetHistory() - }) - - describe('render', () => { - it('should render a SendRowWrapper component', () => { - assert.equal(wrapper.find(SendRowWrapper).length, 1) - }) - - it('should pass the correct props to SendRowWrapper', () => { - const { - label, - showError, - errorType, - } = wrapper.find(SendRowWrapper).props() - - assert.equal(label, 'transactionFee_t:') - assert.equal(showError, 'mockGasFeeError') - assert.equal(errorType, 'gasFee') - }) - - it('should render a GasFeeDisplay as a child of the SendRowWrapper', () => { - assert(wrapper.find(SendRowWrapper).childAt(0).is(GasFeeDisplay)) - }) - - it('should render the GasFeeDisplay with the correct props', () => { - const { - conversionRate, - convertedCurrency, - gasLoadingError, - gasTotal, - onReset, - } = wrapper.find(SendRowWrapper).childAt(0).props() - assert.equal(conversionRate, 20) - assert.equal(convertedCurrency, 'mockConvertedCurrency') - assert.equal(gasLoadingError, false) - assert.equal(gasTotal, 'mockGasTotal') - assert.equal(propsMethodSpies.resetGasButtons.callCount, 0) - onReset() - assert.equal(propsMethodSpies.resetGasButtons.callCount, 1) - }) - - it('should render the GasPriceButtonGroup if gasButtonGroupShown is true', () => { - wrapper.setProps({ gasButtonGroupShown: true }) - const rendered = wrapper.find(SendRowWrapper).childAt(0) - assert.equal(rendered.children().length, 2) - - const gasPriceButtonGroup = rendered.childAt(0) - assert(gasPriceButtonGroup.is(GasPriceButtonGroup)) - assert(gasPriceButtonGroup.hasClass('gas-price-button-group--small')) - assert.equal(gasPriceButtonGroup.props().showCheck, false) - assert.equal(gasPriceButtonGroup.props().someGasPriceButtonGroupProp, 'foo') - assert.equal(gasPriceButtonGroup.props().anotherGasPriceButtonGroupProp, 'bar') - }) - - it('should render an advanced options button if gasButtonGroupShown is true', () => { - wrapper.setProps({ gasButtonGroupShown: true }) - const rendered = wrapper.find(SendRowWrapper).childAt(0) - assert.equal(rendered.children().length, 2) - - const advancedOptionsButton = rendered.childAt(1) - assert.equal(advancedOptionsButton.text(), 'advancedOptions_t') - - assert.equal(propsMethodSpies.showCustomizeGasModal.callCount, 0) - advancedOptionsButton.props().onClick() - assert.equal(propsMethodSpies.showCustomizeGasModal.callCount, 1) - }) - }) -}) |