mirror of
https://github.com/stablyai/orca.git
synced 2026-11-01 17:47:40 +00:00
* test: strengthen launch, subject identity, and release witnesses * test: strengthen approval paths and prompt answer boundaries * test: strengthen conversation names and mobile log persistence * refactor: group background task stop contract with stop operations * test: strengthen question, title, and release validation * test: distinguish row text and generated dispatch titles * test: verify mobile revival events and retry exclusivity * test: reject incomplete child row output assertions * test: verify copied modules and option selection contracts * test: verify mobile host state and status retry boundaries * test: observe connector refusals and real diagnostic delivery * test: consolidate platform memory coverage and verify bounded work * test: allow cached legacy failure reads within work bounds * test: verify packaging boundaries with independent fixtures --------- Co-authored-by: OrcaWin <293788423+OrcaWin@users.noreply.github.com>
58 lines
2.1 KiB
JavaScript
58 lines
2.1 KiB
JavaScript
import { describe, expect, it } from 'vitest'
|
|
import { verifyPackagedBrowserParticipation } from './verify-packaged-browser-participation.mjs'
|
|
|
|
function report() {
|
|
return {
|
|
stats: { expected: 6, skipped: 0, unexpected: 0, flaky: 0 },
|
|
suites: [
|
|
{
|
|
suites: [
|
|
{
|
|
specs: [
|
|
'keeps an old packaged client on the current server-hosted path',
|
|
'keeps a current client on an old packaged server-hosted path'
|
|
].map((title) => ({
|
|
title,
|
|
tests: Array.from({ length: 3 }, () => ({
|
|
expectedStatus: 'passed',
|
|
results: [{ status: 'passed' }]
|
|
}))
|
|
}))
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
describe('Packaged browser participation', () => {
|
|
it('accepts both named scenarios executed three times', () => {
|
|
expect(() => verifyPackagedBrowserParticipation(report())).not.toThrow()
|
|
})
|
|
it.each(['skipped', 'unexpected', 'flaky'])('rejects a nonzero %s result', (key) => {
|
|
const value = report()
|
|
value.stats[key] = 1
|
|
expect(() => verifyPackagedBrowserParticipation(value)).toThrow('participation failed')
|
|
})
|
|
it('rejects missing scenarios even when aggregate counts claim six passes', () => {
|
|
const value = report()
|
|
value.suites[0].suites[0].specs.pop()
|
|
expect(() => verifyPackagedBrowserParticipation(value)).toThrow('requires three executions')
|
|
})
|
|
it('rejects an unrelated scenario substituted for an expected scenario', () => {
|
|
const value = report()
|
|
value.suites[0].suites[0].specs[0].title = 'native shell passes'
|
|
expect(() => verifyPackagedBrowserParticipation(value)).toThrow(
|
|
'Unexpected Packaged browser scenario'
|
|
)
|
|
})
|
|
it('rejects a pass obtained after a failed attempt', () => {
|
|
const value = report()
|
|
value.suites[0].suites[0].specs[0].tests[0].results.unshift({ status: 'failed' })
|
|
expect(() => verifyPackagedBrowserParticipation(value)).toThrow('without retries')
|
|
})
|
|
it('rejects missing report content', () => {
|
|
expect(() => verifyPackagedBrowserParticipation({})).toThrow('participation failed')
|
|
})
|
|
})
|