import { describe, expect, it } from "vitest"; import { createExternalAuthSessionAdapter } from "../../../src/adapters/auth/external-session-adapter.ts"; import { createBffSessionOwner } from "../../../src/features/tech-log/adapters/http/bff-session-owner.ts"; // Template sync (af3d8e6). The runtime closes an external owner without // `readSubject` as `integration-failed`; the HTTP Studio's only owner is this one. describe("BFF session owner", () => { it("is a complete external owner and names no subject", async () => { const owner = createBffSessionOwner( "https://api.example.test/", async () => new Response(null, { status: 401 }), ); // Compiles only while the owner has every method the adapter requires. const session = createExternalAuthSessionAdapter(owner); await owner.recoverSession(); expect(session.getState()).toBe("unauthenticated"); expect(session.getSubject()).toBeNull(); }); });