test(session): cover the turn/end step invariant and content shape guard
- invariant.spec: a turn/end whose step does not match the last opened step fails with 'expected last step'. - session.spec: a seed message whose content is not an array fails with 'message has invalid content'.
This commit is contained in:
@@ -232,6 +232,14 @@ describe('Session', () => {
|
||||
},
|
||||
message: 'message has invalid source',
|
||||
},
|
||||
{
|
||||
name: 'content shape',
|
||||
event: {
|
||||
type: 'user/message', seq: 0, time: 1, surfaceOp: 'append',
|
||||
data: { ...user, content: 'not-an-array' },
|
||||
},
|
||||
message: 'message has invalid content',
|
||||
},
|
||||
{
|
||||
name: 'assistant source',
|
||||
event: {
|
||||
|
||||
Reference in New Issue
Block a user