import { describe, it } from "vitest";
import type { ProductionUseCase } from "@repo/core-shared/conformance";
import type { AuthManifest } from "../feature.manifest";
import type {
  SignInInput,
  SignInOutput,
} from "../application/use-cases/sign-in.use-case";
import { signInUseCase } from "../application/use-cases/sign-in.use-case";

describe("auth.signIn binding slot (type-level)", () => {
  it("rejects an unwrapped factory", () => {
    type Slot = ProductionUseCase<
      SignInInput,
      SignInOutput,
      AuthManifest["useCases"]["signIn"]
    >;

    // Build the unwrapped factory exactly as it would be at the use-case file.
    // It returns a function with no brand attached — must not be assignable.
    const fakeRepo = {} as never;
    const fakeAuth = {} as never;
    const fakeRateLimit = {} as never;
    const unwrapped = signInUseCase(fakeRepo, fakeAuth, fakeRateLimit);

    // @ts-expect-error — unwrapped factory has no __instrumented / __captured brand
    const _bad: Slot = unwrapped;
    void _bad;
  });
});
