-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #271 from cosmos/fabo/209-candidate-profiles
Fabo/209 candidate profiles
- Loading branch information
Showing
4 changed files
with
516 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import setup from '../helpers/vuex-setup' | ||
import PageDelegate from 'renderer/components/staking/PageDelegate' | ||
|
||
describe('PageDelegate', () => { | ||
let wrapper, store, router | ||
let {mount} = setup() | ||
|
||
beforeEach(() => { | ||
let instance = mount(PageDelegate) | ||
wrapper = instance.wrapper | ||
store = instance.store | ||
router = instance.router | ||
|
||
store.commit('addDelegate', { | ||
pub_key: { | ||
type: 'ed25519', | ||
data: 'pubkeyX' | ||
}, | ||
voting_power: 10000, | ||
shares: 5000, | ||
description: { | ||
description: 'descriptionX', | ||
moniker: 'monikerX', | ||
country: 'US' | ||
} | ||
}) | ||
router.push('/staking/delegates/pubkeyX') | ||
}) | ||
|
||
it('has the expected html structure', () => { | ||
expect(wrapper.vm.$el).toMatchSnapshot() | ||
}) | ||
|
||
it('should add/remove candidate to cart', () => { | ||
expect(wrapper.vm.inCart).toBe(false) | ||
wrapper.vm.add(wrapper.vm.delegate) | ||
expect(wrapper.vm.inCart).toBe(true) | ||
wrapper.vm.rm('pubkeyX') | ||
expect(wrapper.vm.inCart).toBe(false) | ||
}) | ||
|
||
it('should show the correct country name', () => { | ||
expect(wrapper.html()).toContain('United States') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.