diff options
author | Dan <danjm.com@gmail.com> | 2018-06-14 21:55:55 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-06-15 02:13:14 +0800 |
commit | bb855707efbcb754f5e4ee4e124f69308bca037d (patch) | |
tree | 56b4c0e9f98f8efd8e8e6cd20d726bd4acc72e2e /ui/app/components/send_/send-content/send-to-row/tests/send-to-row-component.test.js | |
parent | 5995b6d68dccb8d45a14b0665664717b21be5b8b (diff) | |
download | tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.tar.gz tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.tar.zst tangerine-wallet-browser-bb855707efbcb754f5e4ee4e124f69308bca037d.zip |
ENS input in send form shows distinct errors for invalid addresses and non-existent addresses.
Diffstat (limited to 'ui/app/components/send_/send-content/send-to-row/tests/send-to-row-component.test.js')
-rw-r--r-- | ui/app/components/send_/send-content/send-to-row/tests/send-to-row-component.test.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/app/components/send_/send-content/send-to-row/tests/send-to-row-component.test.js b/ui/app/components/send_/send-content/send-to-row/tests/send-to-row-component.test.js index 58fe51dcf..781371004 100644 --- a/ui/app/components/send_/send-content/send-to-row/tests/send-to-row-component.test.js +++ b/ui/app/components/send_/send-content/send-to-row/tests/send-to-row-component.test.js @@ -6,8 +6,8 @@ import proxyquire from 'proxyquire' const SendToRow = proxyquire('../send-to-row.component.js', { './send-to-row.utils.js': { - getToErrorObject: (to) => ({ - to: to === false ? null : `mockToErrorObject:${to}`, + getToErrorObject: (to, toError) => ({ + to: to === false ? null : `mockToErrorObject:${to}${toError}`, }), }, }).default @@ -67,11 +67,11 @@ describe('SendToRow Component', function () { it('should call updateSendToError', () => { assert.equal(propsMethodSpies.updateSendToError.callCount, 0) - instance.handleToChange('mockTo2') + instance.handleToChange('mockTo2', '', 'mockToError') assert.equal(propsMethodSpies.updateSendToError.callCount, 1) assert.deepEqual( propsMethodSpies.updateSendToError.getCall(0).args, - [{ to: 'mockToErrorObject:mockTo2' }] + [{ to: 'mockToErrorObject:mockTo2mockToError' }] ) }) @@ -138,11 +138,11 @@ describe('SendToRow Component', function () { openDropdown() assert.equal(propsMethodSpies.openToDropdown.callCount, 1) assert.equal(SendToRow.prototype.handleToChange.callCount, 0) - onChange('mockNewTo', 'mockNewNickname') + onChange({ toAddress: 'mockNewTo', nickname: 'mockNewNickname', toError: 'mockToError' }) assert.equal(SendToRow.prototype.handleToChange.callCount, 1) assert.deepEqual( SendToRow.prototype.handleToChange.getCall(0).args, - ['mockNewTo', 'mockNewNickname'] + ['mockNewTo', 'mockNewNickname', 'mockToError'] ) }) }) |