chore: initialize from frontend template 4dc033c
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import type { ApplicationApi } from "../../../src/application/create-application.ts";
|
||||
|
||||
export const incompleteApplication: ApplicationApi = {
|
||||
session: {} as ApplicationApi["session"],
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { ApplicationOutputPorts } from "../../../src/application/create-application.ts";
|
||||
|
||||
export const invalidOutputPorts: ApplicationOutputPorts = {
|
||||
session: {
|
||||
getState: () => "signed-in",
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { AsyncOverlay } from "../../../src/application/view-models/async-state.ts";
|
||||
|
||||
export const invalidPendingConflict: AsyncOverlay = {
|
||||
refreshing: false,
|
||||
staleDegraded: false,
|
||||
mutationPending: true,
|
||||
mutationEffectUnknown: false,
|
||||
mutationConflict: true,
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { DiagnosticsPort } from "../../../src/application/ports/diagnostics-port.ts";
|
||||
import type { TelemetryPort } from "../../../src/application/ports/telemetry-port.ts";
|
||||
|
||||
declare const diagnostics: DiagnosticsPort;
|
||||
declare const telemetry: TelemetryPort;
|
||||
|
||||
diagnostics.record({
|
||||
level: "fatal",
|
||||
eventId: "UNKNOWN_DIAGNOSTIC_EVENT",
|
||||
});
|
||||
telemetry.emit("unknown.telemetry.event", {});
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { AppFailure } from "../../../src/contracts/errors.ts";
|
||||
|
||||
export const invalidFailure: AppFailure = {
|
||||
kind: "UNREGISTERED_FAILURE",
|
||||
code: "UNREGISTERED_FAILURE",
|
||||
retryable: false,
|
||||
operationId: "TYPE_FIXTURE",
|
||||
attemptCount: 1,
|
||||
userMessageKey: "error.unknown_failure",
|
||||
action: "contact-support",
|
||||
};
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { ApplicationApi } from "../../../src/application/ports/in/application-api.ts";
|
||||
import type { ReferenceFeatureInput } from "../../../src/features/reference-feature/application/reference-feature-api.ts";
|
||||
|
||||
declare const application: ApplicationApi;
|
||||
declare const referenceFeature: ReferenceFeatureInput;
|
||||
|
||||
application.features.get("not-installed");
|
||||
referenceFeature.listResources;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { IconButton, MenuIcon } from "../../../src/presentation/design-system/index.ts";
|
||||
|
||||
export const InvalidIconButton = <IconButton><MenuIcon /></IconButton>;
|
||||
@@ -0,0 +1,3 @@
|
||||
import { formatMessage } from "../../../src/presentation/i18n/index.ts";
|
||||
|
||||
formatMessage("ko-KR", "unknown.translation.key");
|
||||
@@ -0,0 +1,5 @@
|
||||
import { formatMessage } from "../../../src/presentation/i18n/index.ts";
|
||||
|
||||
formatMessage("en-US", "route.documentTitle");
|
||||
formatMessage("en-US", "route.documentTitle", { title: "Missing app name" });
|
||||
formatMessage("en-US", "action.retry", { unexpected: "value" });
|
||||
@@ -0,0 +1,6 @@
|
||||
import type { PageActionDefinition } from "../../../src/presentation/templates/index.ts";
|
||||
|
||||
export const activeButtonWithoutCallback = {
|
||||
kind: "button",
|
||||
label: "Unsafe active action",
|
||||
} satisfies PageActionDefinition;
|
||||
@@ -0,0 +1,7 @@
|
||||
// This deliberately failing fixture proves that TypeScript rejects a wrong shape.
|
||||
|
||||
function execute(request: { operationId: string }) {
|
||||
return request.operationId;
|
||||
}
|
||||
|
||||
execute({ operationId: 42 });
|
||||
@@ -0,0 +1,7 @@
|
||||
interface ClockPort {
|
||||
now(): number;
|
||||
}
|
||||
|
||||
export const invalidClock: ClockPort = {
|
||||
now: () => "not-a-number",
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { RawReferenceHttpExecutor } from "../../../src/features/reference-feature/adapters/reference-http-gateway.ts";
|
||||
|
||||
declare const http: RawReferenceHttpExecutor;
|
||||
|
||||
http.execute({
|
||||
operationId: "GET_REFERENCE_RESOURCE",
|
||||
routeId: "REFERENCE_RESOURCE_LIST",
|
||||
pathParams: { resourceId: "resource-1" },
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { Result } from "../../../src/application/result.ts";
|
||||
|
||||
export function invalidUnwrap(result: Result<number, string>): number {
|
||||
return result.value;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { ROUTE_RUNTIME_CONTRACT } from "../../../src/features/installed-feature-contracts.ts";
|
||||
|
||||
type RouteId = keyof typeof ROUTE_RUNTIME_CONTRACT;
|
||||
|
||||
export const missingRuntime = {
|
||||
APP_HOME: true,
|
||||
} satisfies Record<RouteId, boolean>;
|
||||
|
||||
export const orphanRuntime = {
|
||||
...Object.fromEntries(
|
||||
Object.keys(ROUTE_RUNTIME_CONTRACT).map((routeId) => [routeId, true]),
|
||||
),
|
||||
ORPHAN_ROUTE: true,
|
||||
} satisfies Record<RouteId, boolean>;
|
||||
Reference in New Issue
Block a user