1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-23 11:46:13 +02:00
metamask-extension/ui/app/pages/send/send-content/send-gas-row/tests/send-gas-row-selectors.test.js
Chi Kei Chan 931aaeb700 Add token selection to the send screen (#6445)
* 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.
2019-04-17 16:45:13 -02:30

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')
})
})
})