diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-09-20 12:16:43 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-12-04 11:36:04 +0800 |
commit | 5354325fab9b9ab3091e3c49e6b940fa713d1799 (patch) | |
tree | 2d1855aa633614a5d786629e125770981efb265c /ui/app/ducks | |
parent | b567c78bcae73e9c73b69040d22e096e4f876a2b (diff) | |
download | tangerine-wallet-browser-5354325fab9b9ab3091e3c49e6b940fa713d1799.tar tangerine-wallet-browser-5354325fab9b9ab3091e3c49e6b940fa713d1799.tar.gz tangerine-wallet-browser-5354325fab9b9ab3091e3c49e6b940fa713d1799.tar.bz2 tangerine-wallet-browser-5354325fab9b9ab3091e3c49e6b940fa713d1799.tar.lz tangerine-wallet-browser-5354325fab9b9ab3091e3c49e6b940fa713d1799.tar.xz tangerine-wallet-browser-5354325fab9b9ab3091e3c49e6b940fa713d1799.tar.zst tangerine-wallet-browser-5354325fab9b9ab3091e3c49e6b940fa713d1799.zip |
Test updates and additions for button integration with send screen.
Diffstat (limited to 'ui/app/ducks')
-rw-r--r-- | ui/app/ducks/tests/send-duck.test.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/ui/app/ducks/tests/send-duck.test.js b/ui/app/ducks/tests/send-duck.test.js index c101132d9..196fe226c 100644 --- a/ui/app/ducks/tests/send-duck.test.js +++ b/ui/app/ducks/tests/send-duck.test.js @@ -6,6 +6,8 @@ import SendReducer, { openToDropdown, closeToDropdown, updateSendErrors, + showGasButtonGroup, + hideGasButtonGroup, } from '../send.duck.js' describe('Send Duck', () => { @@ -18,6 +20,7 @@ describe('Send Duck', () => { fromDropdownOpen: false, toDropdownOpen: false, errors: {}, + gasButtonGroupShown: true, } const OPEN_FROM_DROPDOWN = 'metamask/send/OPEN_FROM_DROPDOWN' const CLOSE_FROM_DROPDOWN = 'metamask/send/CLOSE_FROM_DROPDOWN' @@ -25,6 +28,8 @@ describe('Send Duck', () => { const CLOSE_TO_DROPDOWN = 'metamask/send/CLOSE_TO_DROPDOWN' const UPDATE_SEND_ERRORS = 'metamask/send/UPDATE_SEND_ERRORS' const RESET_SEND_STATE = 'metamask/send/RESET_SEND_STATE' + const SHOW_GAS_BUTTON_GROUP = 'metamask/send/SHOW_GAS_BUTTON_GROUP' + const HIDE_GAS_BUTTON_GROUP = 'metamask/send/HIDE_GAS_BUTTON_GROUP' describe('SendReducer()', () => { it('should initialize state', () => { @@ -85,6 +90,24 @@ describe('Send Duck', () => { ) }) + it('should set gasButtonGroupShown to true when receiving a SHOW_GAS_BUTTON_GROUP action', () => { + assert.deepEqual( + SendReducer(Object.assign({}, mockState, { gasButtonGroupShown: false }), { + type: SHOW_GAS_BUTTON_GROUP, + }), + Object.assign({gasButtonGroupShown: true}, mockState.send) + ) + }) + + it('should set gasButtonGroupShown to false when receiving a HIDE_GAS_BUTTON_GROUP action', () => { + assert.deepEqual( + SendReducer(mockState, { + type: HIDE_GAS_BUTTON_GROUP, + }), + Object.assign({gasButtonGroupShown: false}, mockState.send) + ) + }) + it('should extend send.errors with the value of a UPDATE_SEND_ERRORS action', () => { const modifiedMockState = Object.assign({}, mockState, { send: { @@ -145,6 +168,20 @@ describe('Send Duck', () => { ) }) + describe('showGasButtonGroup', () => { + assert.deepEqual( + showGasButtonGroup(), + { type: SHOW_GAS_BUTTON_GROUP } + ) + }) + + describe('hideGasButtonGroup', () => { + assert.deepEqual( + hideGasButtonGroup(), + { type: HIDE_GAS_BUTTON_GROUP } + ) + }) + describe('updateSendErrors', () => { assert.deepEqual( updateSendErrors('mockErrorObject'), |