Bläddra i källkod

Force site to be defined in Android application

In order to be consistent with all other implementations, we need to disable the generate button if site empty.

Fixes https://github.com/lesspass/lesspass/issues/388
pull/410/head
Guillaume Vincent 5 år sedan
förälder
incheckning
be92dc4862
3 ändrade filer med 22 tillägg och 3 borttagningar
  1. +1
    -1
      mobile/package.json
  2. +5
    -2
      mobile/src/password/validations.js
  3. +16
    -0
      mobile/src/password/validations.test.js

+ 1
- 1
mobile/package.json Visa fil

@@ -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": {


+ 5
- 2
mobile/src/password/validations.js Visa fil

@@ -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 !== ""
);
}

+ 16
- 0
mobile/src/password/validations.test.js Visa fil

@@ -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", () => {


Laddar…
Avbryt
Spara