refactor: 리펙토링
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { describe, expect, it, vi } from "vitest";
|
||||
|
||||
import {
|
||||
buildRouteUrl,
|
||||
@@ -19,8 +19,34 @@ import {
|
||||
} from "../../../src/features/reference-feature/contracts/reference-feature-contract.ts";
|
||||
import type { ReferenceFeatureInput } from "../../../src/features/reference-feature/application/reference-feature-api.ts";
|
||||
import { createTestApplication } from "../../helpers/create-test-application.ts";
|
||||
import { createReferenceFeatureInstalledInput } from "../../../src/features/reference-feature/adapters/create-reference-feature-input.ts";
|
||||
|
||||
describe("reference feature boundary contracts", () => {
|
||||
it("propagates uncertain command effect certainty into the application failure", async () => {
|
||||
const execute = vi.fn(async () => ({
|
||||
kind: "CONTRACT_VIOLATION" as const,
|
||||
violation: {
|
||||
kind: "SUCCESS_SCHEMA_INVALID" as const,
|
||||
operation: "VALIDATION" as const,
|
||||
},
|
||||
effect: "MAYBE_APPLIED" as const,
|
||||
}));
|
||||
const installed = createReferenceFeatureInstalledInput({
|
||||
contractOperations: { execute },
|
||||
});
|
||||
|
||||
await expect(
|
||||
installed.input.createResource({ name: "uncertain" }),
|
||||
).resolves.toMatchObject({
|
||||
ok: false,
|
||||
error: {
|
||||
effect: "MAYBE_APPLIED",
|
||||
retryable: false,
|
||||
action: "contact-support",
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("round-trips one canonical filter through URL and query identity", () => {
|
||||
const filters = {
|
||||
tags: ["open", "new"],
|
||||
|
||||
Reference in New Issue
Block a user