1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 15:49:42 +02:00

fix: eslint errors and failing tests (#2078)

* fix eslint errors

* fix failing tests
This commit is contained in:
Hayden 2023-01-29 13:01:41 -09:00 committed by GitHub
parent 7c766af848
commit 5dc253799d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 35 additions and 29 deletions

View file

@ -1,20 +1,16 @@
import { ref } from "@nuxtjs/composition-api";
import { describe, expect, test } from "vitest";
import { usePasswordStrength } from "./use-passwords";
import { stubI18n } from "~/tests/utils";
// test("test usePasswordField", () => {
// const { inputType, togglePasswordShow, passwordIcon } = usePasswordField();
// expect(inputType.value).toBe("password");
// expect(passwordIcon.value).toBe("mdi-eye");
// togglePasswordShow();
// expect(inputType.value).toBe("text");
// expect(passwordIcon.value).toBe("mdi-eye-off");
// });
describe("test usePasswordStrength", () => {
test("weak password", () => {
const password = ref("123456");
const { score, strength, color } = usePasswordStrength(password);
const pw = ref("123456");
const result = usePasswordStrength(pw, stubI18n());
const { score, strength, color } = result
expect(score.value).toBeGreaterThan(0);
expect(score.value).toBeLessThan(40);
expect(strength.value).toBe("Weak");
@ -23,7 +19,7 @@ describe("test usePasswordStrength", () => {
test("very strong password", () => {
const password = ref("My~Secret~Not~So~Secret?123");
const { score, strength, color } = usePasswordStrength(password);
const { score, strength, color } = usePasswordStrength(password, stubI18n());
expect(score.value).toBeGreaterThan(90);
expect(score.value).toBe(100);
expect(strength.value).toBe("Very Strong");