add onboarding flow with form, validation, db persistence
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { onboardingSchema } from "./schema";
|
||||
|
||||
describe("onboardingSchema", () => {
|
||||
it("accepts valid data", () => {
|
||||
const result = onboardingSchema.safeParse({
|
||||
name: "Max Mustermann",
|
||||
plz: "10115",
|
||||
ort: "Berlin",
|
||||
krankenkasse: "TK",
|
||||
aktueller_schritt: "neu",
|
||||
});
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
|
||||
it("rejects invalid PLZ", () => {
|
||||
const result = onboardingSchema.safeParse({
|
||||
name: "Max",
|
||||
plz: "123",
|
||||
ort: "Berlin",
|
||||
krankenkasse: "TK",
|
||||
aktueller_schritt: "neu",
|
||||
});
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
|
||||
it("rejects empty name", () => {
|
||||
const result = onboardingSchema.safeParse({
|
||||
name: "",
|
||||
plz: "10115",
|
||||
ort: "Berlin",
|
||||
krankenkasse: "TK",
|
||||
aktueller_schritt: "neu",
|
||||
});
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user