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

Fabo/2193 hide import #2194

Merged
merged 7 commits into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from 6 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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- [\#2043](https://github.com/cosmos/voyager/issues/2043) removed no-balance modals on staking page @fedekunze
- [\#2161](https://github.com/cosmos/voyager/pull/2161) fixed status dot position @jbibla
- [\#2193](https://github.com/cosmos/voyager/issues/2193) hide seed import @faboweb

## [1.0.0-beta.14] - 2019-03-06

Expand Down
7 changes: 6 additions & 1 deletion app/src/renderer/components/common/TmSessionWelcome.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<div id="session-welcome" class="tm-session">
<div
id="session-welcome"
class="tm-session"
>
<div class="tm-session-container">
<div class="tm-session-header">
<div class="tm-session-title">
Expand Down Expand Up @@ -33,6 +36,8 @@
@click.native="setState('sign-up')"
/>
<li-session
v-if="session.experimentalMode"
id="import-seed"
icon="settings_backup_restore"
title="Import with seed"
subtitle="Use an existing seed phrase to create an account."
Expand Down
17 changes: 13 additions & 4 deletions test/unit/specs/components/common/TmSessionWelcome.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ describe(`TmSessionWelcome`, () => {

beforeEach(() => {
const getters = {
session: { accounts, insecureMode: true },
session: { accounts, insecureMode: true, experimentalMode: true },
lastPage: `/`
}
$store = {
Expand Down Expand Up @@ -58,7 +58,6 @@ describe(`TmSessionWelcome`, () => {

describe(`without accounts`, () => {
it(`should not show sign-in link since we have no accounts`, () => {
wrapper.vm.setState = jest.fn()
expect(wrapper.find(`#sign-in-with-account`).exists()).toBe(false)
})

Expand Down Expand Up @@ -103,9 +102,19 @@ describe(`TmSessionWelcome`, () => {
})

describe(`production`, () => {
it(`should hide sign in with account in production`, () => {
wrapper.vm.setState = jest.fn()
it(`should hide sign in with account if users do not opt in`, () => {
wrapper.vm.session.accounts = [{
name: `test`
}]
expect(wrapper.find(`#sign-in-with-account`).exists()).toBe(true)
wrapper.vm.session.insecureMode = false
expect(wrapper.find(`#sign-in-with-account`).exists()).toBe(false)
})

it(`should hide seed import if not in development`, () => {
expect(wrapper.find(`#import-seed`).exists()).toBe(true)
wrapper.vm.session.experimentalMode = false
expect(wrapper.find(`#import-seed`).exists()).toBe(false)
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@ exports[`TmSessionWelcome with accounts has the expected html structure 1`] = `
title="Create new account"
/>

<li-session-stub
icon="settings_backup_restore"
subtitle="Use an existing seed phrase to create an account."
title="Import with seed"
/>
<!---->
</div>
</div>
</div>
Expand Down Expand Up @@ -107,6 +103,7 @@ exports[`TmSessionWelcome without accounts has the expected html structure 1`] =

<li-session-stub
icon="settings_backup_restore"
id="import-seed"
subtitle="Use an existing seed phrase to create an account."
title="Import with seed"
/>
Expand Down