|
|
|
@ -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 = [ |
|
|
|
|
{ |
|
|
|
|