diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-10-24 12:22:22 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-12-04 11:36:05 +0800 |
commit | d14af8346af2517db2e50f142377948c9f2ae5e9 (patch) | |
tree | ccdfe345dd000b44c0eedfbee0037969ff2d6f38 /ui/app/selectors/tests/custom-gas.test.js | |
parent | d0619b024fb092182e77e16c6742e157c89b2dc9 (diff) | |
download | tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.tar.gz tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.tar.zst tangerine-wallet-browser-d14af8346af2517db2e50f142377948c9f2ae5e9.zip |
Improve data management and tests for gas-modal-page-container price estimates.
Diffstat (limited to 'ui/app/selectors/tests/custom-gas.test.js')
-rw-r--r-- | ui/app/selectors/tests/custom-gas.test.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ui/app/selectors/tests/custom-gas.test.js b/ui/app/selectors/tests/custom-gas.test.js index 5fde61c9b..1099670f2 100644 --- a/ui/app/selectors/tests/custom-gas.test.js +++ b/ui/app/selectors/tests/custom-gas.test.js @@ -6,6 +6,9 @@ const { getCustomGasLimit, getCustomGasPrice, getCustomGasTotal, + getEstimatedGasPrices, + getEstimatedGasTimes, + getPriceAndTimeEstimates, getRenderableBasicEstimateData, getRenderableEstimateDataForSmallButtons, } = proxyquire('../custom-gas', {}) @@ -40,6 +43,35 @@ describe('custom-gas selectors', () => { }) }) + describe('getPriceAndTimeEstimates', () => { + it('should return price and time estimates', () => { + const mockState = { gas: { priceAndTimeEstimates: 'mockPriceAndTimeEstimates' } } + assert.equal(getPriceAndTimeEstimates(mockState), 'mockPriceAndTimeEstimates') + }) + }) + + describe('getEstimatedGasPrices', () => { + it('should return price and time estimates', () => { + const mockState = { gas: { priceAndTimeEstimates: [ + { gasprice: 12, somethingElse: 20 }, + { gasprice: 22, expectedTime: 30 }, + { gasprice: 32, somethingElse: 40 }, + ] } } + assert.deepEqual(getEstimatedGasPrices(mockState), [12, 22, 32]) + }) + }) + + describe('getEstimatedGasTimes', () => { + it('should return price and time estimates', () => { + const mockState = { gas: { priceAndTimeEstimates: [ + { somethingElse: 12, expectedTime: 20 }, + { gasPrice: 22, expectedTime: 30 }, + { somethingElse: 32, expectedTime: 40 }, + ] } } + assert.deepEqual(getEstimatedGasTimes(mockState), [20, 30, 40]) + }) + }) + describe('getRenderableBasicEstimateData()', () => { const tests = [ { |