Files
archived-orca/src/shared/tab-title-resolution.test.ts
T
8d67f9807c Add opt-in generated agent tab titles (#3224)
* Add opt-in generated agent tab titles

* Preserve generated titles in remote tab sync

Co-authored-by: Orca <help@stably.ai>

---------

Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com>
Co-authored-by: Orca <help@stably.ai>
2026-05-30 12:33:24 -07:00

38 lines
1.1 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { resolveTerminalTabTitle, resolveUnifiedTabLabel } from './tab-title-resolution'
describe('tab title resolution', () => {
it('uses live terminal titles when generated titles are disabled', () => {
expect(
resolveTerminalTabTitle(
{ customTitle: null, generatedTitle: 'Refactor auth', title: 'Claude working' },
false
)
).toBe('Claude working')
})
it('places generated titles between manual and live titles when enabled', () => {
expect(
resolveTerminalTabTitle(
{ customTitle: null, generatedTitle: 'Refactor auth', title: 'Claude working' },
true
)
).toBe('Refactor auth')
expect(
resolveTerminalTabTitle(
{ customTitle: 'Payments', generatedTitle: 'Refactor auth', title: 'Claude working' },
true
)
).toBe('Payments')
})
it('uses the same priority for unified tab labels', () => {
expect(
resolveUnifiedTabLabel(
{ customLabel: null, generatedLabel: 'Fix flaky tests', label: 'Codex working' },
true
)
).toBe('Fix flaky tests')
})
})