Browse Source

Fix save button not present

pull/342/head
Guillaume Vincent 7 years ago
parent
commit
dc2563ad74
3 changed files with 40 additions and 9 deletions
  1. +10
    -9
      src/components/Menu.vue
  2. +1
    -0
      src/views/PasswordGenerator.vue
  3. +29
    -0
      test/e2e/specs/canSavePasswordProfile.js

+ 10
- 9
src/components/Menu.vue View File

@@ -22,21 +22,22 @@
</div>
<div class="col-9 text-right">
<span v-if="saved && isAuthenticated">
<small><i class="fa fa-lg fa-check pl-3" aria-hidden="true"></i> saved</small>
<small><i class="fa fa-lg fa-check pl-3"></i> saved</small>
</span>
<span v-on:click="saveOrUpdatePassword()" class="white-link"
<span class="white-link"
v-on:click="saveOrUpdatePassword()"
v-if="!saved && isAuthenticated && $store.state.password.site !== '' && $store.state.route.path === '/'">
<i class="fa fa-lg fa-save pointer"></i>
</span>
<router-link class="white-link pl-3" :to="{ name: 'passwords'}" v-if="isAuthenticated">
<i class="fa fa-lg fa-key" aria-hidden="true"></i>
<i class="fa fa-lg fa-key"></i>
</router-link>
<button class="white-link btn btn-link p-0 m-0 pl-3" type="button" v-if="isAuthenticated"
v-on:click="logout">
<i class="fa fa-lg fa-sign-out" aria-hidden="true"></i>
<i class="fa fa-lg fa-sign-out"></i>
</button>
<router-link class="white-link pl-3" :to="{ name: 'login'}" v-if="isGuest">
<i class="fa fa-lg fa-sign-in pointer" aria-hidden="true"></i>
<i class="fa fa-lg fa-sign-in pointer"></i>
</router-link>
</div>
</div>
@@ -47,21 +48,21 @@
import {mapState, mapGetters} from 'vuex';

export default {
data(){
data() {
return {
saved: false
}
},
methods: {
fullReload(){
fullReload() {
this.$store.dispatch('savePassword', {password: this.defaultPassword});
this.$router.push({name: 'home'});
},
logout(){
logout() {
this.$store.dispatch('logout');
this.$router.push({name: 'home'});
},
saveOrUpdatePassword(){
saveOrUpdatePassword() {
this.$store.dispatch('saveOrUpdatePassword');
this.saved = true;
setTimeout(() => {


+ 1
- 0
src/views/PasswordGenerator.vue View File

@@ -229,6 +229,7 @@
};
return LessPass.generatePassword(site, login, masterPassword, passwordProfile).then(passwordGenerated => {
this.passwordGenerated = passwordGenerated;
this.$store.dispatch('savePassword', {password: this.password});
this.$store.dispatch('passwordGenerated');
});
},


+ 29
- 0
test/e2e/specs/canSavePasswordProfile.js View File

@@ -0,0 +1,29 @@
var assert = require("assert");

module.exports = {
"Can save password profile": function(browser) {
browser
.url(browser.launch_url)
.waitForElementVisible(".fa-sign-in")
.click(".fa-sign-in")
.setValue("#email", "test@lesspass.com")
.setValue("#passwordField", "test@lesspass.com")
.waitForElementVisible("#encryptMasterPassword__btn")
.click("#encryptMasterPassword__btn")
.waitForElementVisible("#signInButton")
.click("#signInButton")
.waitForElementVisible("#site")
.setValue("#site", "lesspass.com")
.pause(100)
.setValue("#login", "test@lesspass.com")
.pause(100)
.setValue("#passwordField", "test@lesspass.com")
.pause(100)
.waitForElementVisible("#generatePassword__btn")
.click("#generatePassword__btn")
.waitForElementVisible("#generated-password")
.waitForElementVisible(".fa-save");

browser.end();
}
};

Loading…
Cancel
Save