diff --git a/src/components/Menu.vue b/src/components/Menu.vue index f69d1b7..6acdae0 100644 --- a/src/components/Menu.vue +++ b/src/components/Menu.vue @@ -22,21 +22,22 @@
- saved + saved - - + - +
@@ -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(() => { diff --git a/src/views/PasswordGenerator.vue b/src/views/PasswordGenerator.vue index 9260047..82ffd77 100644 --- a/src/views/PasswordGenerator.vue +++ b/src/views/PasswordGenerator.vue @@ -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'); }); }, diff --git a/test/e2e/specs/canSavePasswordProfile.js b/test/e2e/specs/canSavePasswordProfile.js new file mode 100644 index 0000000..c79d1a6 --- /dev/null +++ b/test/e2e/specs/canSavePasswordProfile.js @@ -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(); + } +};