Skip to content

Commit

Permalink
Fabo/bug fixes (#1617)
Browse files Browse the repository at this point in the history
* fixed toolbar overlaying everything

* fixed page transaction showing multiple warnings

* fixed tab my delegations and added tests

* added test for pagetransactions

* changelog
  • Loading branch information
faboweb authored and fedekunze committed Nov 21, 2018
1 parent 0bc545e commit 37488f3
Show file tree
Hide file tree
Showing 8 changed files with 872 additions and 38 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- [\#1590](https://github.com/cosmos/voyager/issues/1590) Fixed empty error notifications caused by latest SDK update @fedekunze
- [\#1596](https://github.com/cosmos/voyager/issues/1596) Fixed error that prevented from triggering updates after submitting a new proposal @fedekunze
- [\#1321](https://github.com/cosmos/voyager/issues/1321) Fixed styling on TmModal @jbibla
- [\#1617](https://github.com/cosmos/voyager/pull/1617) Fixed multiple warnings showing on transactions page @faboweb
- [\#1617](https://github.com/cosmos/voyager/pull/1617) Fixed my validators not showing @faboweb
- [\#1617](https://github.com/cosmos/voyager/pull/1617) Fixed send buttons not clickable @faboweb
- [\#1303](https://github.com/cosmos/voyager/issues/1303) Fixed spamming of setSubscription @faboweb

## [0.10.7] - 2018-10-10
Expand Down
4 changes: 0 additions & 4 deletions app/src/renderer/components/common/VmToolBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ export default {
}
</script>
<style lang="stylus">
.tm-tool-bar
height 100%
.tm-page-header-text
padding-right 1rem
Expand Down
6 changes: 3 additions & 3 deletions app/src/renderer/components/staking/TabMyDelegations.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<template lang="pug">
div
div(v-if="yourValidators > 0")
div(v-if="yourValidators.length > 0")
h3.tab-header
| Active Delegations
|
i.material-icons.info-button(v-tooltip.top="bondInfo") info_outline
table-validators(:validators="yourValidators")

tm-data-msg(v-if="yourValidators < 1", icon="info_outline")
tm-data-msg(v-if="yourValidators.length < 1", icon="info_outline")
div(slot="title") No Active Delegations
div(slot="subtitle") Looks like you haven't delegated any {{ this.bondingDenom }}s yet. Head over to the #[router-link(:to="{name: 'Validators'}") validator list] to make your first delegation!

.check-out-message(v-if="yourValidators > 0")
.check-out-message(v-if="yourValidators.length > 0")
| Check out
|
router-link(:to="{name: 'Validators'}") the validator list
Expand Down
6 changes: 3 additions & 3 deletions app/src/renderer/components/wallet/PageTransactions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ tm-page(data-title='Transactions')
modal-search(type="transactions" v-if="somethingToSearch")

tm-data-loading(v-if="transactions.loading")
tm-data-error(v-if="!transactions.loading && transactions.error")
data-empty-tx(v-if='!transactions.loading && allTransactions.length === 0 && !transactions.error')
data-empty-search(v-if="!transactions.loading && !transactions.error && filteredTransactions.length === 0")
tm-data-error(v-else-if="!transactions.loading && transactions.error")
data-empty-tx(v-else-if='!transactions.loading && allTransactions.length === 0 && !transactions.error')
data-empty-search(v-else-if="!transactions.loading && !transactions.error && filteredTransactions.length === 0")

template(v-else v-for="(tx, i) in filteredTransactions")
tm-li-any-transaction(
Expand Down
109 changes: 88 additions & 21 deletions test/unit/specs/components/staking/TabMyDelegations.spec.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,97 @@
import setup from "../../../helpers/vuex-setup"
import lcdClientMock from "renderer/connectors/lcdClientMock.js"
import TabMyDelegations from "renderer/components/staking/TabMyDelegations"

const delegates = lcdClientMock.candidates

it(`undelegatedValidators`, () => {
expect(
TabMyDelegations.computed.undelegatedValidators({
delegation: {
unbondingDelegations: {
[delegates[1].operator_address]: 1,
[delegates[2].operator_address]: 2
}
},
delegates: { delegates }
describe(`Component: TabMyDelegations`, () => {
let { mount } = setup()

it(`should show committed validators`, () => {
let instance = mount(TabMyDelegations, {
getters: {
committedDelegations: () => ({
[delegates[0].operator_address]: 42
}),
delegates: () => ({
delegates
}),
delegation: () => ({
unbondingDelegations: {
[delegates[1].operator_address]: 1,
[delegates[2].operator_address]: 2
}
}),
bondingDenom: () => `stake`
}
})
).toEqual([delegates[1], delegates[2]])
})

it(`yourValidators`, () => {
expect(
TabMyDelegations.computed.yourValidators({
committedDelegations: {
[delegates[0].operator_address]: 1,
[delegates[2].operator_address]: 2
},
delegates: { delegates }
expect(instance.wrapper.html()).toContain(`Active Delegations`)
expect(instance.wrapper.vm.$el).toMatchSnapshot()
})

it(`should show unbonding validators`, () => {
let instance = mount(TabMyDelegations, {
getters: {
committedDelegations: () => ({}),
delegates: () => ({
delegates
}),
delegation: () => ({
unbondingDelegations: {
[delegates[1].operator_address]: 1,
[delegates[2].operator_address]: 2
}
}),
bondingDenom: () => `stake`
}
})
).toEqual([delegates[0], delegates[2]])

expect(instance.wrapper.html()).toContain(`Inactive Delegations`)
expect(instance.wrapper.vm.$el).toMatchSnapshot()
})

it(`should show a message if not staked yet to any validator`, () => {
let instance = mount(TabMyDelegations, {
getters: {
committedDelegations: () => ({}),
delegates: () => ({
delegates
}),
delegation: () => ({
unbondingDelegations: {}
}),
bondingDenom: () => `stake`
}
})

expect(instance.wrapper.html()).toContain(`No Active Delegations`)
expect(instance.wrapper.vm.$el).toMatchSnapshot()
})

it(`undelegatedValidators`, () => {
expect(
TabMyDelegations.computed.undelegatedValidators({
delegation: {
unbondingDelegations: {
[delegates[1].operator_address]: 1,
[delegates[2].operator_address]: 2
}
},
delegates: { delegates }
})
).toEqual([delegates[1], delegates[2]])
})

it(`yourValidators`, () => {
expect(
TabMyDelegations.computed.yourValidators({
committedDelegations: {
[delegates[0].operator_address]: 1,
[delegates[2].operator_address]: 2
},
delegates: { delegates }
})
).toEqual([delegates[0], delegates[2]])
})
})
Loading

0 comments on commit 37488f3

Please sign in to comment.