Skip to content

Commit 02db13d

Browse files
committed
test(react): pin that useActionEngine no longer harvests the retired keys
CI caught two useActionEngine tests still asserting the metadata harvest this branch removed: getBulkActions() picking up `bulkEnabled: true` and handleShortcut() resolving `shortcut: 'ctrl+k'`, both read off an ActionSchema array. Inverted deliberately rather than reverted. Neither capability has a product consumer — `record-quick-actions` and `record-alert`, the only two callers of this hook, use `getActionsForLocation` / `executeAction` — so removing the harvest broke no live path; the tests were pinning the read of a key that spec 17 retired and that no longer parses. The stale keys stay in the fixture on purpose, so the assertions now prove they are IGNORED — the same shape as plugin-grid's "ignores a stale bulkEnabled flag on an object action". The engine's own bulk / shortcut mechanics keep their coverage in ActionEngine.test.ts, where a host passes those options to registerAction explicitly, which is still supported. Full suite: 9277 passed / 0 failed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9aiswZBzoVYsyLKRuGByE
1 parent d96961e commit 02db13d

1 file changed

Lines changed: 19 additions & 7 deletions

File tree

packages/react/src/hooks/__tests__/useActionEngine.test.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,20 @@ describe('useActionEngine', () => {
7878
});
7979

8080
describe('getBulkActions', () => {
81-
it('returns only bulk-enabled actions', () => {
81+
// Deliberately INVERTED. `sampleActions` still carries the stale
82+
// `bulkEnabled: true` — spec 17 retired the key as a `retiredKey()`
83+
// tombstone, so metadata like this no longer parses at all, and harvesting
84+
// it here made a dead registration option look load-bearing. Same posture
85+
// as plugin-grid's "ignores a stale bulkEnabled flag on an object action".
86+
// The engine's bulk mechanics keep their coverage in ActionEngine.test.ts,
87+
// where a HOST passes `{ bulkEnabled: true }` to `registerAction`
88+
// explicitly — which is still supported.
89+
it('does not harvest the retired bulkEnabled key from metadata', () => {
8290
const { result } = renderHook(() =>
8391
useActionEngine({ actions: sampleActions }),
8492
);
8593

86-
const bulkActions = result.current.getBulkActions();
87-
expect(bulkActions.length).toBe(1);
88-
expect(bulkActions[0].name).toBe('mark_complete');
94+
expect(result.current.getBulkActions()).toEqual([]);
8995
});
9096
});
9197

@@ -119,7 +125,14 @@ describe('useActionEngine', () => {
119125
});
120126

121127
describe('handleShortcut', () => {
122-
it('handles registered keyboard shortcut', async () => {
128+
// Deliberately INVERTED, for the same reason as getBulkActions above:
129+
// `sampleActions` still declares the stale `shortcut: 'ctrl+k'`, which
130+
// spec 17 retired. Its tombstone is explicit that nothing ever consumed it
131+
// ("no keydown listener feeds ActionEngine.getShortcuts(), and objectui's
132+
// keyboard stack is hand-registered and never consults action metadata"),
133+
// so harvesting it only kept a dead path looking alive. A host that wants
134+
// a shortcut still passes one to `registerAction` explicitly.
135+
it('does not harvest the retired shortcut key from metadata', async () => {
123136
const { result } = renderHook(() =>
124137
useActionEngine({ actions: sampleActions }),
125138
);
@@ -129,8 +142,7 @@ describe('useActionEngine', () => {
129142
shortcutResult = await result.current.handleShortcut('ctrl+k');
130143
});
131144

132-
expect(shortcutResult).not.toBeNull();
133-
expect(shortcutResult.success).toBe(true);
145+
expect(shortcutResult).toBeNull();
134146
});
135147

136148
it('returns null for unregistered shortcut', async () => {

0 commit comments

Comments
 (0)