Files
archived-orca/mobile/src/session/agent-session-write-notice-copy.test.ts
Kelvin Amoaba 4e841b7558 fix(native-chat): name and mark the expired attachment when a send is refused (#37552)
* fix(chat): name the attachment that expired when a send is refused

The claim step knew which uploads were gone but threw a bare error, so the
refusal could only say "This attachment expired". It now carries each expired
upload's id and file name: every client names them, and desktop marks those
image chips. Older hosts and clients keep today's generic words.

* test(chat): read expired-attachment details through the wire reader
2026-11-03 02:10:33 +00:00

20 lines
953 B
TypeScript

import { describe, expect, it } from 'vitest'
import { agentSessionWriteNoticeParts } from '../../../src/shared/agent-session/failures/agent-session-refusal-notice'
import { agentSessionRefusalFailure } from '../../../src/shared/agent-session/failures/agent-session-write-failure'
import { mobileAgentSessionWriteNoticeText } from './agent-session-write-notice-copy'
describe('mobileAgentSessionWriteNoticeText', () => {
it('names the attachment an expired refusal lists, as its card labels it', () => {
const failure = agentSessionRefusalFailure({
code: 'agent_session_operation_invalid',
details: {
reason: 'attachmentExpired',
expiredAttachments: [{ uploadId: 'upload-1', name: 'notes.pdf' }]
}
})
expect(
mobileAgentSessionWriteNoticeText(agentSessionWriteNoticeParts(failure, 'composer-send'))
).toBe('notes.pdf expired. Your message was not sent. Remove it and attach it again.')
})
})