-
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.
* 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
Showing
8 changed files
with
872 additions
and
38 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
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
109 changes: 88 additions & 21 deletions
109
test/unit/specs/components/staking/TabMyDelegations.spec.js
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 |
---|---|---|
@@ -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]]) | ||
}) | ||
}) |
Oops, something went wrong.