1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-24 12:23:39 +02:00
metamask-extension/ui/app/pages/send/send-footer/tests/send-footer-selectors.test.js
Whymarrh Whitby 4f3fc95d50
Update ESLint rules for test suite (#8023)
* Use @metamask/eslint-config@1.1.0
* Use eslint-plugin-mocha@6.2.2
* Mark root ESLint config as root
* Update Mocha ESLint rules with shared ESLint config
2020-02-11 13:21:13 -03:30

25 lines
730 B
JavaScript

import assert from 'assert'
import proxyquire from 'proxyquire'
const {
isSendFormInError,
} = proxyquire('../send-footer.selectors', {
'../send.selectors': {
getSendErrors: (mockState) => mockState.errors,
},
})
describe('send-footer selectors', function () {
describe('getTitleKey()', function () {
it('should return true if any of the values of the object returned by getSendErrors are truthy', function () {
assert.equal(isSendFormInError({ errors: { a: 'abc', b: false } }), true)
})
it('should return false if all of the values of the object returned by getSendErrors are falsy', function () {
assert.equal(isSendFormInError({ errors: { a: false, b: null } }), false)
})
})
})