mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-28 23:06:37 +01:00
931aaeb700
* Move send to pages/ * Fix unit tests * Finish UI * Integrate asset dropdown to send actions * Remove console.log * Hide asset change during edit * Enable switch from send token to seand eth * Enable switching from token to eth when editing * Fix linter * Fixing test * Fix unit tests * Fix linter * Fix react warning; remove console.log * fix flat test * Add metrics * Address code review comments * Consistent spacing between send screen form rows. * Reduce height of gas buttons on send screen. * Make send screen gas button height dependent on size of contents.
63 lines
1.3 KiB
JavaScript
63 lines
1.3 KiB
JavaScript
import assert from 'assert'
|
|
import {
|
|
gasFeeIsInError,
|
|
getGasLoadingError,
|
|
getGasButtonGroupShown,
|
|
} 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)
|
|
})
|
|
})
|
|
|
|
describe('getGasButtonGroupShown()', () => {
|
|
it('should return send.gasButtonGroupShown', () => {
|
|
const state = {
|
|
send: {
|
|
gasButtonGroupShown: 'foobar',
|
|
},
|
|
}
|
|
|
|
assert.equal(getGasButtonGroupShown(state), 'foobar')
|
|
})
|
|
})
|
|
|
|
})
|