mirror of
https://github.com/stablyai/orca.git
synced 2026-10-24 08:03:58 +00:00
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Orca <help@stably.ai> Co-authored-by: gsxdsm <gsxdsm@users.noreply.github.com>
16 lines
628 B
TypeScript
16 lines
628 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { mapBaseRefResults } from './mobile-base-ref-search'
|
|
|
|
describe('mapBaseRefResults', () => {
|
|
it('extracts a clean string list from a well-formed payload', () => {
|
|
expect(mapBaseRefResults({ refs: ['main', 'dev'] })).toEqual(['main', 'dev'])
|
|
})
|
|
|
|
it('returns [] for malformed payloads and drops bad entries', () => {
|
|
expect(mapBaseRefResults(null)).toEqual([])
|
|
expect(mapBaseRefResults({})).toEqual([])
|
|
expect(mapBaseRefResults({ refs: 'x' })).toEqual([])
|
|
expect(mapBaseRefResults({ refs: ['ok', 2, '', null, 'two'] })).toEqual(['ok', 'two'])
|
|
})
|
|
})
|