diff options
Diffstat (limited to 'ui/app/pages/send')
-rw-r--r-- | ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js | 4 | ||||
-rw-r--r-- | ui/app/pages/send/send-content/tests/send-content-component.test.js | 7 |
2 files changed, 9 insertions, 2 deletions
diff --git a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js index de2d9462f..1dcd0bd2c 100644 --- a/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js +++ b/ui/app/pages/send/send-content/send-asset-row/send-asset-row.component.js @@ -59,7 +59,7 @@ export default class SendAssetRow extends Component { <SendRowWrapper label={`${t('asset')}:`}> <div className="send-v2__asset-dropdown"> { this.renderSelectedToken() } - { this.renderAssetDropdown() } + { this.props.tokens.length > 0 ? this.renderAssetDropdown() : null } </div> </SendRowWrapper> ) @@ -101,7 +101,7 @@ export default class SendAssetRow extends Component { return ( <div - className="send-v2__asset-dropdown__asset" + className={ this.props.tokens.length > 0 ? 'send-v2__asset-dropdown__asset' : 'send-v2__asset-dropdown__single-asset' } onClick={() => this.selectToken()} > <div className="send-v2__asset-dropdown__asset-icon"> diff --git a/ui/app/pages/send/send-content/tests/send-content-component.test.js b/ui/app/pages/send/send-content/tests/send-content-component.test.js index 521c6523e..d172423ab 100644 --- a/ui/app/pages/send/send-content/tests/send-content-component.test.js +++ b/ui/app/pages/send/send-content/tests/send-content-component.test.js @@ -50,4 +50,11 @@ describe('SendContent Component', function () { assert.equal(PageContainerContentChild.childAt(5).exists(), false) }) }) + + it('should not render the asset dropdown if token length is 0 ', () => { + wrapper.setProps({ tokens: [] }) + const PageContainerContentChild = wrapper.find(PageContainerContent).children() + assert(PageContainerContentChild.childAt(2).is(SendAssetRow)) + assert(PageContainerContentChild.childAt(2).find('send-v2__asset-dropdown__single-asset'), true) + }) }) |