Files
archived-orca/mobile/src/tasks/task-runtime-reply-schema.test.ts
T
OrcaWinandOrcaWin 77ab05bfb1 test: remove 192 low-value mobile tests (#41196)
* test: remove thin mobile forwarding and inventory checks

* test: remove 60 more low-value mobile checks

* test: remove 120 low-value mobile task and document checks

---------

Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
2026-11-11 09:49:53 -08:00

35 lines
1.3 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import {
taskLinearStatusSchema,
taskPreflightSchema,
taskUiStateSchema
} from './task-runtime-reply-schema'
describe('the persisted UI state', () => {
it.each([null, undefined, 'ok', 7, [], true])(
'answers undefined for %j, so the other hydration legs survive an unreadable ui reply',
(payload) => {
const parsed = taskUiStateSchema.safeParse(payload)
expect(parsed.success).toBe(true)
expect(parsed.success ? parsed.data : 'unparsed').toBeUndefined()
}
)
})
describe('the two advisory probes', () => {
// Advisory acceptance still decodes absent/null results; total readers must retain hydration defaults instead of throwing.
it.each([
['absent', undefined],
['null', null],
['a bare string', 'preflight'],
['an array', []]
])('reads a %s payload as "nothing advertised" rather than refusing it', (_label, reply) => {
const preflight = taskPreflightSchema.safeParse(reply)
expect(preflight.success).toBe(true)
expect(preflight.success && preflight.data.glab?.installed).toBeUndefined()
const linear = taskLinearStatusSchema.safeParse(reply)
expect(linear.success).toBe(true)
expect(linear.success && linear.data.connected).toBeUndefined()
})
})