You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.3 KiB
63 lines
1.3 KiB
7 years ago
|
import assert from 'assert'
|
||
|
import {
|
||
7 years ago
|
gasFeeIsInError,
|
||
|
getGasLoadingError,
|
||
6 years ago
|
getGasButtonGroupShown,
|
||
7 years ago
|
} from '../send-gas-row.selectors.js'
|
||
|
|
||
|
describe('send-gas-row selectors', () => {
|
||
|
|
||
7 years ago
|
describe('getGasLoadingError()', () => {
|
||
7 years ago
|
it('should return send.errors.gasLoading', () => {
|
||
|
const state = {
|
||
|
send: {
|
||
|
errors: {
|
||
|
gasLoading: 'abc',
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
|
||
7 years ago
|
assert.equal(getGasLoadingError(state), 'abc')
|
||
|
})
|
||
|
})
|
||
|
|
||
|
describe('gasFeeIsInError()', () => {
|
||
|
it('should return true if send.errors.gasFee is truthy', () => {
|
||
|
const state = {
|
||
|
send: {
|
||
|
errors: {
|
||
|
gasFee: 'def',
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
|
||
|
assert.equal(gasFeeIsInError(state), true)
|
||
|
})
|
||
|
|
||
|
it('should return false send.errors.gasFee is falsely', () => {
|
||
|
const state = {
|
||
|
send: {
|
||
|
errors: {
|
||
|
gasFee: null,
|
||
|
},
|
||
|
},
|
||
|
}
|
||
|
|
||
|
assert.equal(gasFeeIsInError(state), false)
|
||
7 years ago
|
})
|
||
|
})
|
||
|
|
||
6 years ago
|
describe('getGasButtonGroupShown()', () => {
|
||
|
it('should return send.gasButtonGroupShown', () => {
|
||
|
const state = {
|
||
|
send: {
|
||
|
gasButtonGroupShown: 'foobar',
|
||
|
},
|
||
|
}
|
||
|
|
||
|
assert.equal(getGasButtonGroupShown(state), 'foobar')
|
||
|
})
|
||
|
})
|
||
|
|
||
7 years ago
|
})
|