feat: publish CodexPi contest snapshot
Some checks are pending
Qualité / tests (push) Waiting to run
Some checks are pending
Qualité / tests (push) Waiting to run
This commit is contained in:
23
frontend/tests/retryMessage.test.ts
Normal file
23
frontend/tests/retryMessage.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import {retryPayload} from '../src/retryMessage.ts'
|
||||
|
||||
test('retry preserves the original message and attachment identifiers', () => {
|
||||
const payload=retryPayload({
|
||||
id:'message-1',
|
||||
role:'user',
|
||||
content:'Analyse cette capture',
|
||||
metadata:{attachments:[
|
||||
{id:'attachment-1',original_name:'capture.png',content_type:'image/png',size:42,url:'/attachment-1'},
|
||||
]},
|
||||
})
|
||||
assert.deepEqual(payload,{content:'Analyse cette capture',attachment_ids:['attachment-1']})
|
||||
})
|
||||
|
||||
test('retry keeps a text-only message valid', () => {
|
||||
assert.deepEqual(retryPayload({id:'message-2',role:'user',content:'Réessaie',metadata:{}}),{
|
||||
content:'Réessaie',
|
||||
attachment_ids:[],
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user