First Commit. Duplicate bunext-sqlite preset

This commit is contained in:
2026-10-18 16:47:11 +01:00
commit 81e4a8aecc
718 changed files with 41695 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { describe, expect, test } from "bun:test";
import { AppData } from "@/src/data/app-data";
import validatePassword from "./validate-password";
describe("validatePassword", () => {
test("rejects an empty password", () => {
expect(validatePassword({ password: "" })).toBeString();
expect(validatePassword({})).toBeString();
});
test("rejects passwords shorter than the minimum", () => {
const password = "a".repeat(AppData["PasswordMinLength"] - 1);
expect(validatePassword({ password })).toContain("at least");
});
test("rejects passwords longer than the maximum", () => {
const password = "a".repeat(AppData["PasswordMaxLength"] + 1);
expect(validatePassword({ password })).toContain("longer than");
});
test("rejects whitespace-only passwords", () => {
const password = " ".repeat(AppData["PasswordMinLength"]);
expect(validatePassword({ password })).toContain("spaces");
});
test("accepts a password at the minimum length", () => {
const password = "a".repeat(AppData["PasswordMinLength"]);
expect(validatePassword({ password })).toBeUndefined();
});
});