Files
hermes-agent/apps/desktop/src/lib/session-source.test.ts
teknium1 93f06eda5b test: purge low-value tests, lane js04 (249 removed)
Change-detectors, tautologies, source-reading tests, redundant duplicates,
mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane
ledger (category + reason for every removal).
2026-09-23 03:15:26 -07:00

32 lines
1.3 KiB
TypeScript

import { describe, expect, it } from 'vitest'
import { isMessagingSource, sessionSourceSearchTerms } from './session-source'
// Regression guard for #46761 / PR #47395: Photon (iMessage) must keep its own
// sidebar section. refreshMessagingSessions() filters rows through
// isMessagingSource(), so this entry is the sole condition that keeps Photon
// sessions out of generic recents. A silent removal would regress the feature
// with no test failure — these asserts pin the contract.
describe('photon messaging source registration', () => {
it('treats photon as a messaging source (own sidebar section)', () => {
expect(isMessagingSource('photon')).toBe(true)
})
it('is case/space insensitive on the source id', () => {
expect(isMessagingSource('PHOTON')).toBe(true)
expect(isMessagingSource(' photon ')).toBe(true)
})
it('exposes the iMessage/messages search aliases so Photon sessions are findable', () => {
const terms = sessionSourceSearchTerms('photon')
expect(terms).toContain('imessage')
expect(terms).toContain('messages')
})
it('does not flag local/CLI-ish sources as messaging (guard sanity)', () => {
expect(isMessagingSource('cli')).toBe(false)
expect(isMessagingSource(null)).toBe(false)
expect(isMessagingSource(undefined)).toBe(false)
})
})