Skip to content

Commit

Permalink
Merge pull request #328 from cosmos/matt/319-lidelegate-loop-fix
Browse files Browse the repository at this point in the history
LiDelegate loop fix
  • Loading branch information
jbibla authored Jan 4, 2018
2 parents 446c2ea + 1745709 commit 1736afd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
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

0 comments on commit 1736afd

Please sign in to comment.