2018-05-05 17:11:53 +02:00
|
|
|
import assert from 'assert'
|
|
|
|
import {
|
|
|
|
sendAmountIsInError,
|
|
|
|
} from '../send-amount-row.selectors.js'
|
|
|
|
|
2020-02-11 17:51:13 +01:00
|
|
|
describe('send-amount-row selectors', function () {
|
2018-05-05 17:11:53 +02:00
|
|
|
|
2020-02-11 17:51:13 +01:00
|
|
|
describe('sendAmountIsInError()', function () {
|
|
|
|
it('should return true if send.errors.amount is truthy', function () {
|
2018-05-05 17:11:53 +02:00
|
|
|
const state = {
|
|
|
|
send: {
|
|
|
|
errors: {
|
|
|
|
amount: 'abc',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.equal(sendAmountIsInError(state), true)
|
|
|
|
})
|
|
|
|
|
2020-02-11 17:51:13 +01:00
|
|
|
it('should return false if send.errors.amount is falsy', function () {
|
2018-05-05 17:11:53 +02:00
|
|
|
const state = {
|
|
|
|
send: {
|
|
|
|
errors: {
|
|
|
|
amount: null,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
assert.equal(sendAmountIsInError(state), false)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
})
|