mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-06 06:41:56 +00:00
* feat(web): make session header metadata configurable * fix(web): align mobile header metadata priority
22 lines
1.3 KiB
TypeScript
22 lines
1.3 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { selectMobileSessionHeaderSecondary } from './sessionHeaderMobileMetadata'
|
|
|
|
describe('selectMobileSessionHeaderSecondary', () => {
|
|
it('follows the upstream-first display order', () => {
|
|
expect(selectMobileSessionHeaderSecondary({ machine: true, model: true, updatedAt: true })).toBe('machine')
|
|
expect(selectMobileSessionHeaderSecondary({ model: true, updatedAt: true, worktree: true })).toBe('model')
|
|
})
|
|
|
|
it('uses the next enabled and available detail when the model is absent', () => {
|
|
expect(selectMobileSessionHeaderSecondary({ machine: true, lastActive: true, updatedAt: true })).toBe('machine')
|
|
expect(selectMobileSessionHeaderSecondary({ lastActive: true, updatedAt: true })).toBe('lastActive')
|
|
expect(selectMobileSessionHeaderSecondary({ fastMode: true, updatedAt: true, createdAt: true, worktree: true })).toBe('fastMode')
|
|
expect(selectMobileSessionHeaderSecondary({ updatedAt: true, createdAt: true, worktree: true })).toBe('createdAt')
|
|
expect(selectMobileSessionHeaderSecondary({ worktree: true, fastMode: true })).toBe('fastMode')
|
|
})
|
|
|
|
it('returns no secondary detail when none are available', () => {
|
|
expect(selectMobileSessionHeaderSecondary({})).toBeNull()
|
|
})
|
|
})
|