diff --git a/.changeset/menu-icon-test-phantom-value.md b/.changeset/menu-icon-test-phantom-value.md new file mode 100644 index 0000000000..ca89894e20 --- /dev/null +++ b/.changeset/menu-icon-test-phantom-value.md @@ -0,0 +1,7 @@ +--- +--- + +Test-only change: the two overlay-menu icon suites (`context-menu-item-icon`, +`dropdown-menu-item-icon`) no longer transcribe the undeclared `value` key from +the catalog fixtures objectui#7072 cleaned, and each block now records why the +key is absent. No published source and no rendered behaviour changes. diff --git a/packages/components/src/__tests__/context-menu-item-icon.test.tsx b/packages/components/src/__tests__/context-menu-item-icon.test.tsx index 3571026447..e3c8a6a394 100644 --- a/packages/components/src/__tests__/context-menu-item-icon.test.tsx +++ b/packages/components/src/__tests__/context-menu-item-icon.test.tsx @@ -164,13 +164,23 @@ describe('ui:context-menu item icon resolution (objectui#6278)', () => { // specimen AND a declared AI few-shot retrieval source, so every name it // ships must draw. Spelling drift is the gate's job (see the header); // this row is the renderer's half of that contract. + // + // ⛔ No `value` key here, and its absence is deliberate. These items are a + // TRANSCRIPTION of the fixture, so a key the fixture does not carry is a + // spelling the next author copies out of here. No arm of the `MenuItem` + // union declares `value` — objectui#6523 narrowed that union on purpose — + // and no menu renderer reads it; objectui#7072 deleted it from the four + // catalog fixtures and objectui#7102 from these copies. Re-adding it would + // NOT go red: `MenuItemSchema`'s arms are non-strict `z.object`s, so zod + // strips the key and reports success. Hence this note rather than a pin — + // a parse-based pin here could not fail. it('draws a distinct glyph for each of the four authored names', () => { renderMenu([ - { label: 'Copy', value: 'copy', icon: 'copy' }, - { label: 'Cut', value: 'cut', icon: 'scissors' }, - { label: 'Paste', value: 'paste', icon: 'clipboard' }, + { label: 'Copy', icon: 'copy' }, + { label: 'Cut', icon: 'scissors' }, + { label: 'Paste', icon: 'clipboard' }, { separator: true }, - { label: 'Delete', value: 'delete', icon: 'trash' }, + { label: 'Delete', icon: 'trash' }, ]); for (const [label, name] of [ ['Copy', 'copy'], diff --git a/packages/components/src/__tests__/dropdown-menu-item-icon.test.tsx b/packages/components/src/__tests__/dropdown-menu-item-icon.test.tsx index 959d480d24..b36bb05990 100644 --- a/packages/components/src/__tests__/dropdown-menu-item-icon.test.tsx +++ b/packages/components/src/__tests__/dropdown-menu-item-icon.test.tsx @@ -117,11 +117,19 @@ describe('ui:dropdown-menu item icon resolution (objectui#5930)', () => { // The fixture is a live specimen AND a declared AI few-shot retrieval // source, so every name it ships must actually draw. `square-pen` is the // identity-derived live key for the retired `edit` this fixture carried. + // + // ⛔ No `value` key here, and its absence is deliberate — same reason as + // the twin block in `context-menu-item-icon.test.tsx`, which carries the + // long form. In short: no arm of the `MenuItem` union declares `value` + // (objectui#6523), no menu renderer reads it, objectui#7072 removed it + // from the fixtures and objectui#7102 from these copies — and re-adding + // it could not go red, because `MenuItemSchema` is non-strict and strips + // the key while reporting success. it('draws a glyph for every icon name it declares', () => { renderMenu([ - { label: 'Edit', value: 'edit', icon: 'square-pen' }, - { label: 'Copy', value: 'copy', icon: 'copy' }, - { label: 'Delete', value: 'delete', icon: 'trash' }, + { label: 'Edit', icon: 'square-pen' }, + { label: 'Copy', icon: 'copy' }, + { label: 'Delete', icon: 'trash' }, ]); for (const label of ['Edit', 'Copy', 'Delete']) { expect(glyphFor(label), `${label} should draw a glyph`).not.toBeNull();