aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/gas-customization/gas-modal-page-container/tests
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-08-08 21:51:06 +0800
committerDan Miller <danjm.com@gmail.com>2018-12-04 11:36:04 +0800
commit99c8804eeb8c3e407fa9f2d806c145113ec6ec2c (patch)
tree01c25072da3d50c46a8e6851342dfb6fe37be480 /ui/app/components/gas-customization/gas-modal-page-container/tests
parent3b9ec8e1bc8f3db9cfd645b10e4908f06096c70c (diff)
downloadtangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.tar.gz
tangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.tar.zst
tangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.zip
Add tests for advanced-tab-component.js and subcomponents.
Diffstat (limited to 'ui/app/components/gas-customization/gas-modal-page-container/tests')
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js18
1 files changed, 14 insertions, 4 deletions
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js b/ui/app/components/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js
index 32f644765..8bf72647a 100644
--- a/ui/app/components/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js
+++ b/ui/app/components/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-component.test.js
@@ -1,6 +1,6 @@
import React from 'react'
import assert from 'assert'
-import { shallow } from 'enzyme'
+import shallow from '../../../../../lib/shallow-with-context'
import sinon from 'sinon'
import GasModalPageContainer from '../gas-modal-page-container.component.js'
@@ -17,6 +17,10 @@ describe('GasModalPageContainer Component', function () {
beforeEach(() => {
wrapper = shallow(<GasModalPageContainer
hideModal={propsMethodSpies.hideModal}
+ updateCustomGasPrice={() => 'mockupdateCustomGasPrice'}
+ updateCustomGasLimit={() => 'mockupdateCustomGasLimit'}
+ customGasPrice={21}
+ customGasLimit={54321}
/>, { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } })
})
@@ -147,10 +151,16 @@ describe('GasModalPageContainer Component', function () {
})
describe('renderAdvancedTabContent', () => {
- it('should render', () => {
+ it('should render with the correct props', () => {
const renderAdvancedTabContentResult = wrapper.instance().renderAdvancedTabContent()
- const renderedAdvancedTabContent = shallow(renderAdvancedTabContentResult)
- assert.equal(renderedAdvancedTabContent.props().className, 'gas-modal-content__advanced-tab')
+ const advancedTabContentProps = renderAdvancedTabContentResult.props
+ assert.equal(advancedTabContentProps.updateCustomGasPrice(), 'mockupdateCustomGasPrice')
+ assert.equal(advancedTabContentProps.updateCustomGasLimit(), 'mockupdateCustomGasLimit')
+ assert.equal(advancedTabContentProps.customGasPrice, 21)
+ assert.equal(advancedTabContentProps.customGasLimit, 54321)
+ assert.equal(advancedTabContentProps.millisecondsRemaining, 91000)
+ assert.equal(advancedTabContentProps.totalFee, '$0.30')
+ assert(shallow(renderAdvancedTabContentResult).hasClass('advanced-tab'))
})
})
})