Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LiDelegate loop fix #328

Merged
merged 2 commits into from
Jan 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/renderer/components/staking/LiDelegate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default {
},
vpTotal () {
return this.delegates
.slice()
.sort((a, b) => b.voting_power - a.voting_power)
.slice(0, 100)
.reduce((sum, v) => sum + v.voting_power, 0)
Expand Down
6 changes: 3 additions & 3 deletions test/unit/specs/LiDelegate.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ describe('LiDelegate', () => {
})

it('should show the voting power', () => {
expect(wrapper.html()).toContain('75%')
expect(wrapper.html()).toContain('25%')
})

it('should show the number of bonded atoms', () => {
expect(wrapper.html()).toContain('30,000')
expect(wrapper.html()).toContain('10,000')
})

it('should show the relative voting power as a bar', () => {
expect(wrapper.vm.$el.querySelector('.voting_power .bar').style.width).toBe('100%')
expect(wrapper.vm.$el.querySelector('.voting_power .bar').style.width).toBe('33%')
})

it('should add to cart', () => {
Expand Down