aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/button-group/tests
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-09-20 12:16:43 +0800
committerDan Miller <danjm.com@gmail.com>2018-12-04 11:36:04 +0800
commit5354325fab9b9ab3091e3c49e6b940fa713d1799 (patch)
tree2d1855aa633614a5d786629e125770981efb265c /ui/app/components/button-group/tests
parentb567c78bcae73e9c73b69040d22e096e4f876a2b (diff)
downloadtangerine-wallet-browser-5354325fab9b9ab3091e3c49e6b940fa713d1799.tar.gz
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/components/button-group/tests')
-rw-r--r--ui/app/components/button-group/tests/button-group-component.test.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/ui/app/components/button-group/tests/button-group-component.test.js b/ui/app/components/button-group/tests/button-group-component.test.js
index f07bb97c8..0bece90d6 100644
--- a/ui/app/components/button-group/tests/button-group-component.test.js
+++ b/ui/app/components/button-group/tests/button-group-component.test.js
@@ -35,6 +35,20 @@ describe('ButtonGroup Component', function () {
ButtonGroup.prototype.renderButtons.resetHistory()
})
+ describe('componentDidUpdate', () => {
+ it('should set the activeButtonIndex to the updated newActiveButtonIndex', () => {
+ assert.equal(wrapper.state('activeButtonIndex'), 1)
+ wrapper.setProps({ newActiveButtonIndex: 2 })
+ assert.equal(wrapper.state('activeButtonIndex'), 2)
+ })
+
+ it('should not set the activeButtonIndex to an updated newActiveButtonIndex that is not a number', () => {
+ assert.equal(wrapper.state('activeButtonIndex'), 1)
+ wrapper.setProps({ newActiveButtonIndex: null })
+ assert.equal(wrapper.state('activeButtonIndex'), 1)
+ })
+ })
+
describe('handleButtonClick', () => {
it('should set the activeButtonIndex', () => {
assert.equal(wrapper.state('activeButtonIndex'), 1)