Files
orca/src/main/computer/computer-action-verification-normalization.test.ts
T
Brennan Benson 2a760e310b fix(computer): report unasserted accessibility actions (#15028)
* fix(computer): report unasserted accessibility actions

* fix(computer): fail closed on missing action metadata

* Fix merged tab search test fixture
2026-08-18 11:29:26 -07:00

28 lines
1.0 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import type { ComputerActionResult } from '../../shared/runtime-types'
import { normalizeComputerActionResult } from './computer-action-verification-normalization'
describe('normalizeComputerActionResult', () => {
it('marks accessibility actions without a post-state assertion as unverified', () => {
const result: ComputerActionResult = {
snapshot: {
id: 'snap-1',
app: { name: 'Finder', bundleId: 'com.apple.finder', pid: 100 },
window: { title: 'Finder', id: 42, width: 800, height: 600 },
coordinateSpace: 'window',
treeText: 'tree',
elementCount: 1,
focusedElementId: null
},
screenshot: null,
screenshotStatus: { state: 'skipped', reason: 'no_screenshot_flag' },
action: { path: 'accessibility', actionName: 'click' }
}
expect(normalizeComputerActionResult(result).action?.verification).toEqual({
state: 'unverified',
reason: 'accessibility_action_unasserted'
})
})
})