mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-12 20:57:12 +01:00
b3d78ed8a1
Revert accidentally changed constants. Require defaults in ens-input, gas-fee-display and confirm screens.
50 lines
982 B
JavaScript
50 lines
982 B
JavaScript
import assert from 'assert'
|
|
import {
|
|
gasFeeIsInError,
|
|
getGasLoadingError,
|
|
} from '../send-gas-row.selectors.js'
|
|
|
|
describe('send-gas-row selectors', () => {
|
|
|
|
describe('getGasLoadingError()', () => {
|
|
it('should return send.errors.gasLoading', () => {
|
|
const state = {
|
|
send: {
|
|
errors: {
|
|
gasLoading: 'abc',
|
|
},
|
|
},
|
|
}
|
|
|
|
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)
|
|
})
|
|
})
|
|
|
|
})
|