Remove unused `network` prop (#8633)
The `Identicon` component was being passed a `network` prop, despite not accepting a `network` prop. A duplicate set of `token-cell` tests have also been deleted, as they used this prop. The tests were never run, because the file was misnamed (it needs to be named `.test.js`).feature/default_network_editable
parent
f748664638
commit
91953f062b
@ -1,64 +0,0 @@ |
||||
import React from 'react' |
||||
import assert from 'assert' |
||||
import thunk from 'redux-thunk' |
||||
import { Provider } from 'react-redux' |
||||
import configureMockStore from 'redux-mock-store' |
||||
import { mount } from 'enzyme' |
||||
|
||||
import TokenCell from '../token-cell' |
||||
import Identicon from '../../ui/identicon' |
||||
|
||||
describe('Token Cell', function () { |
||||
let wrapper |
||||
|
||||
const state = { |
||||
metamask: { |
||||
network: 'test', |
||||
currentCurrency: 'usd', |
||||
selectedTokenAddress: '0xToken', |
||||
selectedAddress: '0xAddress', |
||||
contractExchangeRates: { |
||||
'0xAnotherToken': 0.015, |
||||
}, |
||||
conversionRate: 7.00, |
||||
}, |
||||
} |
||||
|
||||
const middlewares = [thunk] |
||||
const mockStore = configureMockStore(middlewares) |
||||
const store = mockStore(state) |
||||
|
||||
beforeEach(function () { |
||||
wrapper = mount( |
||||
<Provider store={store}> |
||||
<TokenCell |
||||
address="0xAnotherToken" |
||||
symbol="TEST" |
||||
string="5.000" |
||||
network={22} |
||||
currentCurrency="usd" |
||||
image="./test-image" |
||||
/> |
||||
</Provider> |
||||
) |
||||
}) |
||||
|
||||
it('renders Identicon with props from token cell', function () { |
||||
assert.equal(wrapper.find(Identicon).prop('address'), '0xAnotherToken') |
||||
assert.equal(wrapper.find(Identicon).prop('network'), 'test') |
||||
assert.equal(wrapper.find(Identicon).prop('image'), './test-image') |
||||
}) |
||||
|
||||
it('renders token balance', function () { |
||||
assert.equal(wrapper.find('.token-cell__token-balance').text(), '5.000') |
||||
}) |
||||
|
||||
it('renders token symbol', function () { |
||||
assert.equal(wrapper.find('.token-cell__token-symbol').text(), 'TEST') |
||||
}) |
||||
|
||||
it('renders converted fiat amount', function () { |
||||
assert.equal(wrapper.find('.token-cell__fiat-amount').text(), '0.52 USD') |
||||
}) |
||||
|
||||
}) |
Loading…
Reference in new issue