feat: Wabenhain Honig-Shop Anwendung
Vollstaendige Next.js/Prisma-E-Commerce-Anwendung fuer eine Imkerei: Shop, Warenkorb, Stripe-Checkout, Kundenkonto mit 2FA, Admin-Bereich (Produkte, Ernten, Chargen, Bestellungen, Gutscheine, admin-editierbare Website-Inhalte), i18n (DE/EN), Rate-Limiting/CSP/Audit-Log-Haertung, PostgreSQL- und MySQL-Unterstuetzung ueber austauschbare Prisma- Treiber-Adapter, Unit-/Komponenten-/E2E-Tests.
This commit is contained in:
1 parent
5c76fcc266
commit
c7927f2883
240 files changed
+26096
-137
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { describe, test, expect } from "vitest";
|
||||
import { asStringArray } from "./json-array";
|
||||
|
||||
describe("asStringArray", () => {
|
||||
test("passes an array of strings through unchanged", () => {
|
||||
expect(asStringArray(["mild", "floral"])).toEqual(["mild", "floral"]);
|
||||
});
|
||||
|
||||
test("returns an empty array for an empty array", () => {
|
||||
expect(asStringArray([])).toEqual([]);
|
||||
});
|
||||
|
||||
test("drops non-string entries from a mixed array", () => {
|
||||
expect(asStringArray(["mild", 5, null, "floral", { a: 1 }])).toEqual(["mild", "floral"]);
|
||||
});
|
||||
|
||||
test("returns an empty array for null", () => {
|
||||
expect(asStringArray(null)).toEqual([]);
|
||||
});
|
||||
|
||||
test("returns an empty array for undefined", () => {
|
||||
expect(asStringArray(undefined)).toEqual([]);
|
||||
});
|
||||
|
||||
test("returns an empty array for a plain object", () => {
|
||||
expect(asStringArray({ tasteTags: ["mild"] })).toEqual([]);
|
||||
});
|
||||
|
||||
test("returns an empty array for a scalar string", () => {
|
||||
expect(asStringArray("mild")).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user