feat: select the TechLog Studio adapter from runtime configuration
Adds TECH_LOG_STUDIO_SOURCE (MOCK | HTTP, default MOCK) to the V2 runtime
config schema so a build can switch createTechLogFeatureInstalledInput
between the mock and HTTP Studio gateways without a rebuild. V1 documents
predate the key and always normalize to MOCK. The HTTP gateway is
constructed with only { operations } per Task 4's actual signature -
no CSRF provider is wired here; that lands with attachCredentials at a
later composition-root task.
Updates every existing Studio test call site to the new required
createTechLogFeatureInstalledInput(context) signature via a shared
tests/helpers/studio-install-context.ts MOCK fixture, so the whole
existing Studio suite keeps exercising the mock adapter unchanged.
This commit is contained in:
@@ -7,6 +7,7 @@ import { MemoryRouter, useLocation, useNavigate } from "react-router-dom";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { createTechLogFeatureInstalledInput } from "../../../src/features/tech-log/adapters/create-tech-log-feature-input.ts";
|
||||
import { MOCK_STUDIO_INSTALL_CONTEXT } from "../../helpers/studio-install-context.ts";
|
||||
import { FIXTURE_IDS } from "../../../src/features/tech-log/adapters/mock/fixtures.ts";
|
||||
import type { StudioGateway } from "../../../src/features/tech-log/application/ports/studio-gateway.ts";
|
||||
import type { WorkingCopyInput } from "../../../src/features/tech-log/contracts/studio/contract.ts";
|
||||
@@ -68,7 +69,7 @@ function LocationProbe() {
|
||||
describe("TechLog Studio project decision authoring", () => {
|
||||
it("creates Decision as the fourth working-copy type", async () => {
|
||||
const user = userEvent.setup();
|
||||
const gateway = createTechLogFeatureInstalledInput().input.createStudioGateway();
|
||||
const gateway = createTechLogFeatureInstalledInput(MOCK_STUDIO_INSTALL_CONTEXT).input.createStudioGateway();
|
||||
render(
|
||||
<MemoryRouter initialEntries={["/studio/documents/new"]}>
|
||||
<RouterStudioProvider gateway={gateway}>
|
||||
@@ -91,7 +92,7 @@ describe("TechLog Studio project decision authoring", () => {
|
||||
});
|
||||
|
||||
it("validates, previews, and publishes a project-scoped Decision", async () => {
|
||||
const gateway = createTechLogFeatureInstalledInput().input.createStudioGateway();
|
||||
const gateway = createTechLogFeatureInstalledInput(MOCK_STUDIO_INSTALL_CONTEXT).input.createStudioGateway();
|
||||
const document = await gateway.createDocument(decisionInput(), {
|
||||
idempotencyKey: "create-project-decision",
|
||||
});
|
||||
@@ -133,7 +134,7 @@ describe("TechLog Studio project decision authoring", () => {
|
||||
|
||||
it("edits Decision fields and renders the project decision card preview", async () => {
|
||||
const user = userEvent.setup();
|
||||
const gateway = createTechLogFeatureInstalledInput().input.createStudioGateway();
|
||||
const gateway = createTechLogFeatureInstalledInput(MOCK_STUDIO_INSTALL_CONTEXT).input.createStudioGateway();
|
||||
const document = await gateway.createDocument(decisionInput(), {
|
||||
idempotencyKey: "edit-project-decision",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user