From 44d98de2367b99808d78db732ec7d72533266233 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Wed, 14 Oct 2026 17:55:22 +0800 Subject: [PATCH] test: align malformed XML and route seed assertions with owning contracts --- .../apple/KeyedArchiveReader.test.ts | 4 ++- ...avascriptFeatureSeed.array_members.test.ts | 25 ++++++++++++++++++- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/artifacts/apple/KeyedArchiveReader.test.ts b/src/artifacts/apple/KeyedArchiveReader.test.ts index a0b0f1b736..71f62c8136 100644 --- a/src/artifacts/apple/KeyedArchiveReader.test.ts +++ b/src/artifacts/apple/KeyedArchiveReader.test.ts @@ -33,7 +33,9 @@ describe("inert keyed archive decoding", () => { decodeKeyedArchiveBytes(bytes, { offset: 0, limit: 1 }), ).toThrow( expect.objectContaining({ - code: "ERR_ENCODING_INVALID_ENCODED_DATA", + name: "XmlPlistTextDecodeError", + reason: "invalid-bytes", + cause: expect.any(TypeError), }), ); } diff --git a/src/domain/javascript/javascriptFeatureSeed.array_members.test.ts b/src/domain/javascript/javascriptFeatureSeed.array_members.test.ts index 50f6ceb095..f8a57c53ea 100644 --- a/src/domain/javascript/javascriptFeatureSeed.array_members.test.ts +++ b/src/domain/javascript/javascriptFeatureSeed.array_members.test.ts @@ -165,7 +165,6 @@ describe("feature seed selection controls", () => { { kind: "module", nodeKind: "javascript-module", field: "original_source" }, { kind: "native-export", nodeKind: "native-export", field: "label" }, { kind: "native-export", nodeKind: "native-export", field: "key" }, - { kind: "route", nodeKind: "endpoint", field: "label" }, { kind: "route", nodeKind: "endpoint", field: "value" }, { kind: "route", nodeKind: "endpoint", field: "path" }, { kind: "channel", nodeKind: "ipc-channel", field: "label" }, @@ -192,6 +191,30 @@ describe("feature seed selection controls", () => { }, ); + it("excludes route labels while preserving generic scalar and array matching", () => { + const scalar = memberNode("endpoint", { + endpoint_kind: "route", + label: "route endpoint", + }); + const array = memberNode("endpoint", { + endpoint_kind: "route", + label: ["route endpoint"], + }); + + expect( + findApplicationFeatureSeeds([scalar], seed("route", "route endpoint")), + ).toEqual([]); + expect( + findApplicationFeatureSeeds([array], seed("route", "route endpoint")), + ).toEqual([]); + expect( + findApplicationFeatureSeeds([scalar], seed("string", "route endpoint")), + ).toEqual([propertyMatch(scalar, "label")]); + expect( + findApplicationFeatureSeeds([array], seed("string", "route endpoint")), + ).toEqual([propertyMatch(array, "label[0]")]); + }); + it("keeps generic matching and scalar label and identity selection", () => { const node = memberNode("context-bridge-api", { members: ["openProject"] }); expect(findApplicationFeatureSeeds([node], seed("string"))).toEqual([