import { describe, expect, test } from "bun:test";
import { invitedSignupOverrides } from "./invited-user";

describe("invitedSignupOverrides", () => {
  // An invited address is proven by the invite link AND joins an org that
  // already has its own plan/setup — so the new user must skip BOTH email
  // verification and the onboarding wizard. Missing onboardingCompletedAt is the
  // bug: the (app) gate then forces a *forfait* on a member of a paid org.
  test("skips email verification and onboarding", () => {
    const now = new Date("2026-06-19T10:00:00Z");
    const overrides = invitedSignupOverrides(now);
    expect(overrides.emailVerified).toBe(true);
    expect(overrides.onboardingCompletedAt).toEqual(now);
  });
});
