Sfoglia il codice sorgente

Fix prettier

pull/618/head
Guillaume Vincent 3 anni fa
parent
commit
db69e1983e
15 ha cambiato i file con 42 aggiunte e 26 eliminazioni
  1. +1
    -1
      packages/lesspass-pure/package.json
  2. +3
    -1
      packages/lesspass-pure/src/api/password.test.js
  3. +10
    -3
      packages/lesspass-pure/src/api/user.test.js
  4. +1
    -1
      packages/lesspass-pure/src/i18n/de.json
  5. +1
    -1
      packages/lesspass-pure/src/i18n/es.json
  6. +1
    -1
      packages/lesspass-pure/src/i18n/fr.json
  7. +1
    -1
      packages/lesspass-pure/src/i18n/pl.json
  8. +1
    -1
      packages/lesspass-pure/src/i18n/pt.json
  9. +1
    -1
      packages/lesspass-pure/src/i18n/ru.json
  10. +1
    -1
      packages/lesspass-pure/src/i18n/zh-CN.json
  11. +1
    -1
      packages/lesspass-pure/src/i18n/zh-TW.json
  12. +1
    -1
      packages/lesspass-pure/src/services/localStore.js
  13. +14
    -8
      packages/lesspass-pure/src/services/url-parser.test.js
  14. +2
    -1
      packages/lesspass-pure/src/store/getters.js
  15. +3
    -3
      packages/lesspass-pure/src/store/mutations.test.js

+ 1
- 1
packages/lesspass-pure/package.json Vedi File

@@ -9,7 +9,7 @@
"build": "vue-cli-service build",
"i18n:build": "node src/i18n/build.js",
"i18n:translate": "node src/i18n/translate.js",
"prettier": "prettier --write src/",
"prettier": "prettier --write 'src/**/*'",
"cypress:run": "cypress run",
"cypress:open": "cypress open",
"test": "npm run test:unit && npm run test:e2e",


+ 3
- 1
packages/lesspass-pure/src/api/password.test.js Vedi File

@@ -6,7 +6,9 @@ const mock = new MockAdapter(axios);

test("Passwords.create", () => {
const password = { login: "text@example.org" };
mock.onPost("https://api.lesspass.com/passwords/", password).reply(201, { ...password, id: "1" });
mock
.onPost("https://api.lesspass.com/passwords/", password)
.reply(201, { ...password, id: "1" });
return Passwords.create(password).then(response => {
const passwordCreated = response.data;
expect(passwordCreated.id).toBe("1");


+ 10
- 3
packages/lesspass-pure/src/api/user.test.js Vedi File

@@ -8,7 +8,9 @@ test("login", () => {
const access = "12345";
const refresh = "67890";
const user = { email: "test@example.org", password: "password" };
mock.onPost("https://api.lesspass.com/auth/jwt/create/", user).reply(201, { access, refresh });
mock
.onPost("https://api.lesspass.com/auth/jwt/create/", user)
.reply(201, { access, refresh });
return User.login(user).then(response => {
expect(response.data.access).toBe(access);
expect(response.data.refresh).toBe(refresh);
@@ -27,7 +29,9 @@ test("register", () => {

test("resetPassword", () => {
var email = "test@lesspass.com";
mock.onPost("https://api.lesspass.com/auth/users/reset_password/", { email }).reply(204);
mock
.onPost("https://api.lesspass.com/auth/users/reset_password/", { email })
.reply(204);
return User.resetPassword({ email }).then(response => {
expect(response.status).toBe(204);
});
@@ -41,7 +45,10 @@ test("confirmResetPassword", () => {
re_new_password: "password1"
};
mock
.onPost("https://api.lesspass.com/auth/users/reset_password_confirm/", newPassword)
.onPost(
"https://api.lesspass.com/auth/users/reset_password_confirm/",
newPassword
)
.reply(204);
return User.confirmResetPassword({
uid: "MQ",


+ 1
- 1
packages/lesspass-pure/src/i18n/de.json Vedi File

@@ -65,4 +65,4 @@
"noAutoFillSite": "Füllen Sie das Site-Feld nicht mehr automatisch aus",
"removeSiteSubdomain": "Subdomain von der Site entfernen",
"resetPasswordSuccess": "Wenn die E-Mail-Adresse {email} mit einem LessPass-Konto verknüpft ist, erhalten Sie in Kürze eine E-Mail von LessPass mit Anweisungen zum Zurücksetzen Ihres Passworts."
}
}

+ 1
- 1
packages/lesspass-pure/src/i18n/es.json Vedi File

@@ -65,4 +65,4 @@
"noAutoFillSite": "Deje de completar el campo del sitio automáticamente",
"removeSiteSubdomain": "Eliminar subdominio del sitio",
"resetPasswordSuccess": "Si la dirección de correo electrónico {email} está asociada a una cuenta LessPass, recibirá un correo electrónico de LessPass con instrucciones sobre cómo restablecer su contraseña."
}
}

+ 1
- 1
packages/lesspass-pure/src/i18n/fr.json Vedi File

@@ -65,4 +65,4 @@
"noAutoFillSite": "Arrêtez de remplir automatiquement le champ site",
"removeSiteSubdomain": "Supprimer le sous-domaine du site",
"resetPasswordSuccess": "Si l'adresse email {email} est associée avec un compte LessPass, vous allez recevoir un email de la part de LessPass avec les instructions pour changer votre mot de passe."
}
}

+ 1
- 1
packages/lesspass-pure/src/i18n/pl.json Vedi File

@@ -65,4 +65,4 @@
"noAutoFillSite": "Przestań automatycznie wypełniać pole witryny",
"removeSiteSubdomain": "Usuń subdomenę z witryny",
"resetPasswordSuccess": "Jeśli adres {email} jest skojarzony z kontem LessPass, wkrótce otrzymasz wiadomość od LessPass zawierającą instrukcje resetowania hasła."
}
}

+ 1
- 1
packages/lesspass-pure/src/i18n/pt.json Vedi File

@@ -65,4 +65,4 @@
"noAutoFillSite": "Pare de preencher o campo do site automaticamente",
"removeSiteSubdomain": "Remover subdomínio do site",
"resetPasswordSuccess": "Se o seu endereço de email {email} estiver associado com uma conta LessPass, você receberá logo um email do LessPass com instruções de como resetar a sua senha."
}
}

+ 1
- 1
packages/lesspass-pure/src/i18n/ru.json Vedi File

@@ -65,4 +65,4 @@
"noAutoFillSite": "Прекратить автоматическое заполнение поля сайта",
"removeSiteSubdomain": "Удалить субдомен с сайта",
"resetPasswordSuccess": "Если адрес электронной почты {email} связан с учетной записью LessPass, вы получите электронное письмо от LessPass с инструкциями по восстановлению пароля."
}
}

+ 1
- 1
packages/lesspass-pure/src/i18n/zh-CN.json Vedi File

@@ -65,4 +65,4 @@
"noAutoFillSite": "停止自动填写站点字段",
"removeSiteSubdomain": "从网站删除子域",
"resetPasswordSuccess": "如果电子邮件地址 {email} 与一个 LessPass 账户相关联,您将很快收到 LessPass 的电子邮件,里面提供有重置密码的操作说明。"
}
}

+ 1
- 1
packages/lesspass-pure/src/i18n/zh-TW.json Vedi File

@@ -65,4 +65,4 @@
"noAutoFillSite": "停止自動填寫站點字段",
"removeSiteSubdomain": "從網站刪除子域",
"resetPasswordSuccess": "如果郵件位址 {email} 已和 LessPass 帳號連動,您很快能收到 LessPass 的信件,當中提供如何重置密碼的說明。"
}
}

+ 1
- 1
packages/lesspass-pure/src/services/localStore.js Vedi File

@@ -1 +1 @@
export const key = "lesspass-v2"
export const key = "lesspass-v2";

+ 14
- 8
packages/lesspass-pure/src/services/url-parser.test.js Vedi File

@@ -42,7 +42,9 @@ test("cleanUrl beta", () => {
expect(urlParser.removeSiteSubdomain("https://api.lesspass.com/")).toBe(
"lesspass.com"
);
expect(urlParser.removeSiteSubdomain("http://lesspass.com")).toBe("lesspass.com");
expect(urlParser.removeSiteSubdomain("http://lesspass.com")).toBe(
"lesspass.com"
);
expect(urlParser.removeSiteSubdomain("http://www.lesspass.com")).toBe(
"lesspass.com"
);
@@ -61,18 +63,22 @@ test("cleanUrl beta", () => {
"https://accounts.google.com/ServiceLogin?service=mail&passive=true&rm=false&continue=https://mail.google.com/mail/&ss=1&scc=1&ltmpl=default&ltmplcache=2&emr=1&osid=1#identifier"
)
).toBe("google.com");
expect(urlParser.removeSiteSubdomain("https://mail.google.com/mail/u/0/")).toBe(
"google.com"
);
expect(
urlParser.removeSiteSubdomain("https://mail.google.com/mail/u/0/")
).toBe("google.com");
expect(urlParser.removeSiteSubdomain("https://www.netflix.com/browse")).toBe(
"netflix.com"
);
expect(urlParser.removeSiteSubdomain("https://www.bbc.co.uk")).toBe("bbc.co.uk");
expect(urlParser.removeSiteSubdomain("https://192.168.1.1:10443/webapp/")).toBe(
"192.168.1.1"
expect(urlParser.removeSiteSubdomain("https://www.bbc.co.uk")).toBe(
"bbc.co.uk"
);
expect(
urlParser.removeSiteSubdomain("https://192.168.1.1:10443/webapp/")
).toBe("192.168.1.1");
expect(urlParser.removeSiteSubdomain(undefined)).toBe("");
expect(urlParser.removeSiteSubdomain("chrome://extensions/")).toBe("extensions");
expect(urlParser.removeSiteSubdomain("chrome://extensions/")).toBe(
"extensions"
);
});

test("getSuggestions", () => {


+ 2
- 1
packages/lesspass-pure/src/store/getters.js Vedi File

@@ -12,4 +12,5 @@ export const passwordURL = state => {

export const shouldAutoFillSite = state => !state.settings.noAutoFillSite;

export const shouldRemoveSubdomain = state => state.settings.removeSiteSubdomain;
export const shouldRemoveSubdomain = state =>
state.settings.removeSiteSubdomain;

+ 3
- 3
packages/lesspass-pure/src/store/mutations.test.js Vedi File

@@ -275,7 +275,7 @@ test("SET_SITE default state", () => {
test("SET_SITE ignore empty", () => {
const state = {
password: {
"site": "www.example.org"
site: "www.example.org"
},
passwords: [],
defaultPassword
@@ -288,8 +288,8 @@ test("SET_SITE ignore empty", () => {
test("SET_SITE ignore if id set", () => {
const state = {
password: {
"id": "1",
"site": "www.example.org"
id: "1",
site: "www.example.org"
},
passwords: [],
defaultPassword


Caricamento…
Annulla
Salva