Pārlūkot izejas kodu

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 pirms 5 gadiem
vecāks
revīzija
be92dc4862
3 mainītis faili ar 22 papildinājumiem un 3 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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 Parādīt failu

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


Notiek ielāde…
Atcelt
Saglabāt