diff --git a/mobile/package.json b/mobile/package.json index 19e7d96..865f3e5 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -1,6 +1,6 @@ { "name": "lesspass-mobile", - "version": "3.1.2", + "version": "3.1.3", "description": "LessPass mobile application", "license": "(MPL-2.0 OR GPL-3.0)", "author": { diff --git a/mobile/src/password/validations.js b/mobile/src/password/validations.js index c501b54..8ef887a 100644 --- a/mobile/src/password/validations.js +++ b/mobile/src/password/validations.js @@ -22,9 +22,12 @@ export function areOptionsValid(options) { } export function isProfileValid(profile) { - const { options } = profile; + const { site, options } = profile; const { length, counter } = options; return ( - isLengthValid(length) && isCounterValid(counter) && areOptionsValid(options) + isLengthValid(length) && + isCounterValid(counter) && + areOptionsValid(options) && + site !== "" ); } diff --git a/mobile/src/password/validations.test.js b/mobile/src/password/validations.test.js index 471ded5..1ef5847 100644 --- a/mobile/src/password/validations.test.js +++ b/mobile/src/password/validations.test.js @@ -98,6 +98,22 @@ describe("validation", () => { symbols: true } }) + ).toBe(false); + }); + it("with only site", () => { + expect( + isProfileValid({ + site: "lesspass", + login: "", + options: { + length: 16, + counter: 1, + lowercase: true, + uppercase: true, + digits: true, + symbols: true + } + }) ).toBe(true); }); it("no options", () => {