From 62932f9919e49bbc0bf90665c2d2876a8e40e1f5 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Wed, 18 Nov 2026 12:32:39 +0800 Subject: [PATCH] test(environment): consolidate create-call reference coverage (#11978) --- .../environmentStateCreateCalls.test.ts | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/domain/analysisView/environmentStateCreateCalls.test.ts b/src/domain/analysisView/environmentStateCreateCalls.test.ts index 26aa4c3f3e..f0c5888350 100644 --- a/src/domain/analysisView/environmentStateCreateCalls.test.ts +++ b/src/domain/analysisView/environmentStateCreateCalls.test.ts @@ -6,7 +6,6 @@ import { } from "../../../tests/fixtures/analysisView.js"; import { HELD_FIXED_TAG_ROWS, - TAG_ROWS, misshelvedRows, referencedCreateRows, shelvedRows, @@ -63,11 +62,7 @@ describe("create plans learned from every call", () => { }); }); - it.each([ - { id: 1, name: "Different Hall", floor: "ground" }, - { id: 2, name: "Map Room", floor: "upper" }, - null, - ])( + it.each([{ id: 2, name: "Map Room", floor: "upper" }, null])( "withholds a create whose sent reference contradicts its answer (%j)", (shelf) => { expect(createPlan(referencedCreateRows(shelf))).toMatchObject({ @@ -86,7 +81,6 @@ describe("create plans learned from every call", () => { }); it("trims no clock a later create shows trimmed after a held entity showed it at a fixed width", () => { - expect(createPlan(TAG_ROWS, "post_tags")).toMatchObject({ served: true }); const plan = createPlan(HELD_FIXED_TAG_ROWS, "post_tags"); expect(plan).toMatchObject({ served: false, reason: "unexplained-change" }); expect(plan.rules).not.toContainEqual( @@ -175,24 +169,16 @@ describe("merging a later create into a plan", () => { }); const unshelvedExemplar = { id: 3, name: "Third" }; - it("takes a reference one call alone shows when the other did not send its member", () => { - const merged = mergedCreatePlan( - plan, - unshelvedExemplar, - shelved(4, "Fourth"), - ); - expect(merged).toMatchObject({ - rules: expect.arrayContaining([reference]), - body: { accepted: ["name", "shelf_id"], required: ["name"] }, - }); - }); - - it("keeps a reference an earlier call added through calls that leave it out, and agrees with it when it returns", () => { + it("adds an optional reference and keeps it through later omission and return", () => { const added = mergedCreatePlan( plan, unshelvedExemplar, shelved(4, "Fourth"), )!; + expect(added).toMatchObject({ + rules: expect.arrayContaining([reference]), + body: { accepted: ["name", "shelf_id"], required: ["name"] }, + }); const omitted = mergedCreatePlan( added, unshelvedExemplar,