refactor: 템플릿에서 기본적으로 제공하고 있는 워크 플로우에 디자인과 라우팅 흡수

This commit is contained in:
donghyeon-ka
2026-09-23 12:42:10 +09:00
parent afde2b1da1
commit aaa384c145
181 changed files with 12553 additions and 5280 deletions
@@ -615,6 +615,52 @@ describe("application mutation reconciliation bridge", () => {
expect(invalidateQueries).not.toHaveBeenCalled();
});
it("uses a canonical identity projection without changing the bound transport input", async () => {
const client = queryClient();
const scope = scopeSnapshot();
const file = new File(["payload"], "diagram.svg", {
type: "image/svg+xml",
});
const input = { file, stableId: "diagram.svg:7" };
const execute = vi.fn(
async (
received: typeof input,
context: Readonly<{
signal: AbortSignal;
intent: import("../../src/contracts/mutation-intent.ts").MutationIntent;
}>,
) => {
expect(received.file).toBe(file);
expect(context.intent.idempotencyKey).toBeTruthy();
return { ok: true as const, value: received.stableId };
},
);
const hook = renderHook(
() =>
useApplicationMutation<typeof input, string>({
definitionId: "host-object-identity-v1",
definitionVersion: 1,
operationId: "UPLOAD",
requiresIdempotencyKey: true,
owner: "platform-test",
duplicatePolicy: "REJECT_WHILE_ACTIVE",
scope,
identity: (value) => ({ stableId: value.stableId }),
execute,
invalidate: [],
}),
{ wrapper: wrapper(client) },
);
let outcome: ApplicationResult<string> | undefined;
await act(async () => {
outcome = await hook.result.current.submit(input);
});
expect(outcome).toEqual({ ok: true, value: "diagram.svg:7" });
expect(execute).toHaveBeenCalledOnce();
});
it("restores a bound unknown-effect head after controller remount", async () => {
const client = queryClient();
const scope = scopeSnapshot();