test(agents): make picker baseline proof omit OMP aliases

This commit is contained in:
Neil
2026-09-14 13:57:59 -07:00
parent 1c23d52a7d
commit c8d319fe7b
2 changed files with 9 additions and 3 deletions
@@ -4,13 +4,17 @@ import AgentCombobox from '../../../src/renderer/src/components/agent/AgentCombo
import { getAgentCatalog } from '../../../src/renderer/src/lib/agent-catalog'
import type { TuiAgent } from '../../../src/shared/tui-agent'
import './fixture.css'
const baseline = new URLSearchParams(window.location.search).get('baseline') === '1'
const agents = getAgentCatalog().map((agent) =>
baseline && agent.id === 'omp' ? { ...agent, searchAliases: [] } : agent
)
function App() {
const [selected, setSelected] = useState<TuiAgent | null>(null)
return (
<main className="p-6 bg-background text-foreground space-y-4">
<h1>Agent picker</h1>
<AgentCombobox
agents={getAgentCatalog()}
agents={agents}
value={selected}
onValueChange={setSelected}
allowBlankTerminal={false}
@@ -44,11 +44,13 @@ try {
errors.push(error.message)
console.error(error)
})
await page.goto(pathToFileURL(path.join(output, 'renderer/index.html')).href)
const baseline = process.env.ORCA_OMP_PICKER_BASELINE === '1'
const fixtureUrl = pathToFileURL(path.join(output, 'renderer/index.html'))
if (baseline) fixtureUrl.searchParams.set('baseline', '1')
await page.goto(fixtureUrl.href)
await page.locator('button[role=combobox]').click()
const search = page.getByPlaceholder('Search agents...')
await search.fill('oh-my-pi')
const baseline = process.env.ORCA_OMP_PICKER_BASELINE === '1'
await expect(
baseline
? page.getByText('No agents match your search.')