Files
tech-log-frontend/tests/features/tech-log/feature-input.test.ts
T

34 lines
1.2 KiB
TypeScript

import { describe, expect, it } from "vitest";
import type { ApplicationFeatureInputs } from "../../../src/application/ports/in/application-api.ts";
import {
TECH_LOG_FEATURE_ID,
type TechLogFeatureInput,
} from "../../../src/features/tech-log/application/tech-log-feature-input.ts";
import type { PublicContentQueries } from "../../../src/features/tech-log/application/ports/public-content-queries.ts";
import type { StudioGateway } from "../../../src/features/tech-log/application/ports/studio-gateway.ts";
function acceptsApplicationFeatureInput(
input: ApplicationFeatureInputs["tech-log"],
): TechLogFeatureInput {
return input;
}
describe("TechLog feature input", () => {
it("uses the fixed application feature identifier", () => {
expect(TECH_LOG_FEATURE_ID).toBe("tech-log");
});
it("accepts public queries and a Studio gateway factory through the application registry", () => {
const publicContent = {} as PublicContentQueries;
const gateway = {} as StudioGateway;
const input = acceptsApplicationFeatureInput({
publicContent,
createStudioGateway: () => gateway,
});
expect(input.publicContent).toBe(publicContent);
expect(input.createStudioGateway()).toBe(gateway);
});
});