Skip to content

Commit d04527e

Browse files
committed
fix(coverage): repoint hover evidence off the retired runtime.ts source line
The touch family's additive-facts refactor dropped every owner's explicit hover: unavailable cell in favor of the family-level unsupported fallback, so the coverage manifests' literal-substring checks against packages/platform-apple/src/runtime.ts and packages/platform-linux/src/runtime.ts broke: that source line no longer exists. Point the macOS, iOS, tvOS, and Linux hover rows at new tests that assert the typed unavailable denial directly against each owner's bound facts, instead of re-adding a hand-written denial line the refactor was meant to retire. Refs #2412
1 parent 898c309 commit d04527e

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

‎packages/platform-apple/src/runtime.test.ts‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { listIosApps } from './core/app-resolution.ts';
99
import type { DeviceBinding, RuntimeFacts } from '@agent-device/contracts/platform-runtime';
1010
import type { PlatformRuntimeOperations } from '@agent-device/contracts/platform-runtime-operations';
1111
import type { SnapshotRuntimeHost } from '@agent-device/contracts/snapshot-runtime';
12+
import { HOVER_UNAVAILABLE_HINT } from '@agent-device/contracts/touch-runtime';
1213
import type { AppleOS, DeviceInfo } from '@agent-device/kernel/device';
1314
import { createApplePlatformRuntime } from './runtime.ts';
1415
import { platformRuntimeHostFixture } from './runtime.fixtures.ts';
@@ -220,6 +221,29 @@ test.each(Object.entries(leaves))(
220221
},
221222
);
222223

224+
test('hover has no Apple interactor route on macOS, iOS, or tvOS; the touch family reports its typed denial', async () => {
225+
for (const device of [leaves.macos, leaves.ios, leaves.tvos]) {
226+
const binding = await createApplePlatformRuntime(platformRuntimeHostFixture()).bind({
227+
device,
228+
intent: { kind: 'ordinary' },
229+
scope: {
230+
signal: new AbortController().signal,
231+
diagnostics: { emit: () => {} },
232+
progress: { report: () => {} },
233+
},
234+
});
235+
const hoverDenial = {
236+
available: false,
237+
reason: 'unsupported-platform-leaf',
238+
hint: HOVER_UNAVAILABLE_HINT,
239+
};
240+
expect(binding.facts.operations.hoverPoint).toEqual(hoverDenial);
241+
expect(binding.facts.operations.hoverRef).toEqual(hoverDenial);
242+
expect(binding.operations.hoverPoint).toBeTypeOf('undefined');
243+
expect(binding.operations.hoverRef).toBeTypeOf('undefined');
244+
}
245+
});
246+
223247
/** Both the fact and the bound operation function agree on availability, for one operation. */
224248
function expectOperationAvailability(
225249
binding: DeviceBinding<PlatformRuntimeOperations>,

‎packages/platform-linux/src/runtime.test.ts‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type {
55
PlatformRuntimeOperations,
66
} from '@agent-device/contracts/platform-runtime-operations';
77
import type { SnapshotRuntimeHost } from '@agent-device/contracts/snapshot-runtime';
8+
import { HOVER_UNAVAILABLE_HINT } from '@agent-device/contracts/touch-runtime';
89
import type { DeviceInfo } from '@agent-device/kernel/device';
910
import { createLinuxPlatformRuntime } from './runtime.ts';
1011

@@ -306,6 +307,24 @@ test.each([
306307
expect(facts.operations.gestureViewport.available).toBe(false);
307308
});
308309

310+
test('hover has no Linux interactor route; the touch family reports its typed denial', async () => {
311+
const facts = await createLinuxPlatformRuntime(lifecycleHost()).inspectFacts({
312+
platform: 'linux',
313+
id: 'linux',
314+
name: 'Linux',
315+
kind: 'device',
316+
target: 'desktop',
317+
booted: true,
318+
});
319+
const hoverDenial = {
320+
available: false,
321+
reason: 'unsupported-platform-leaf',
322+
hint: HOVER_UNAVAILABLE_HINT,
323+
};
324+
expect(facts.operations.hoverPoint).toEqual(hoverDenial);
325+
expect(facts.operations.hoverRef).toEqual(hoverDenial);
326+
});
327+
309328
test('binds the Linux coordinate-fling tier without a frame read', async () => {
310329
const binding = await createLinuxPlatformRuntime(lifecycleHost()).bind({
311330
device: {

0 commit comments

Comments
 (0)