diff --git a/src/containers/Ledgers/Ledgers.jsx b/src/containers/Ledgers/Ledgers.jsx index e7c228a3a..c92db7336 100644 --- a/src/containers/Ledgers/Ledgers.jsx +++ b/src/containers/Ledgers/Ledgers.jsx @@ -13,7 +13,7 @@ import { getAction, getCategory } from '../shared/components/Transaction' import { TransactionActionIcon } from '../shared/components/TransactionActionIcon/TransactionActionIcon' import { Legend } from './Legend' import { RouteLink } from '../shared/routing' -import { LEDGER_ROUTE, TRANSACTION_ROUTE } from '../App/routes' +import { LEDGER_ROUTE, TRANSACTION_ROUTE, VALIDATOR_ROUTE } from '../App/routes' class Ledgers extends Component { constructor(props) { @@ -71,13 +71,16 @@ class Ledgers extends Component { renderSelected = () => { const { validators, selected } = this.state const v = validators[selected] || {} - const url = `/validators/${selected}` return (
{v.domain && } - + {selected} - +
) } diff --git a/src/containers/Ledgers/test/LedgersPage.test.js b/src/containers/Ledgers/test/LedgersPage.test.js index b35c3bdb7..2b5f474f4 100644 --- a/src/containers/Ledgers/test/LedgersPage.test.js +++ b/src/containers/Ledgers/test/LedgersPage.test.js @@ -81,14 +81,14 @@ describe('Ledgers Page container', () => { let client const middlewares = [thunk] const mockStore = configureMockStore(middlewares) - const createWrapper = (props = { network: 'main' }) => { + const createWrapper = (props = { network: 'main', path: '/' }) => { const store = mockStore({ ...initialState }) return mount( - + @@ -200,11 +200,11 @@ describe('Ledgers Page container', () => { validations.first().simulate('mouseLeave') expect(wrapper.find('.tooltip').length).toBe(0) validations.first().simulate('focus') - expect(wrapper.find('.selected-validator .pubkey').length).toBe(0) + expect(wrapper.find('.selected-validator a.pubkey').length).toBe(0) validations.first().simulate('click') // set selected - expect(wrapper.find('.selected-validator .pubkey').length).toBe(1) + expect(wrapper.find('.selected-validator a.pubkey').length).toBe(1) validations.first().simulate('click') // unset selected - expect(wrapper.find('.selected-validator .pubkey').length).toBe(0) + expect(wrapper.find('.selected-validator a.pubkey').length).toBe(0) wrapper.unmount() @@ -235,7 +235,10 @@ describe('Ledgers Page container', () => { }, ) - const wrapper = createWrapper({ network: customNetwork }) + const wrapper = createWrapper({ + network: customNetwork, + path: '/my.custom.com', + }) expect(wrapper.find('.ledger').length).toBe(0) expect(wrapper.find('.validation').length).toBe(0) @@ -289,7 +292,11 @@ describe('Ledgers Page container', () => { validations.first().simulate('focus') expect(wrapper.find('.selected-validator .pubkey').length).toBe(0) validations.first().simulate('click') // set selected - expect(wrapper.find('.selected-validator .pubkey').length).toBe(1) + expect(wrapper.find('.selected-validator a.pubkey').length).toBe(1) + expect(wrapper.find('.selected-validator a.pubkey')).toHaveProp( + 'href', + '/validators/n9KaxgJv69FucW5kkiaMhCqS6sAR1wUVxpZaZmLGVXxAcAse9YhR', + ) validations.first().simulate('click') // unset selected expect(wrapper.find('.selected-validator .pubkey').length).toBe(0)