test(time-context): align the real-API assertion with the snapshot form

The e2e lane pinned the pre-form source shape, so it failed on CI while the
unit lane passed; the reading is now a `snapshot`-form context carrying one
named contribution.
This commit is contained in:
creatixchu
2026-08-05 16:19:50 +08:00
parent b7034e4a26
commit 01f99aa544

View File

@@ -56,7 +56,14 @@ describe('time-context through a real headless cordis.yml', () => {
for (let index = 0; index < contexts.length; index += 1) {
expect(contexts[index]!.seq).toBeLessThan(starts[index]!.seq)
expect(contexts[index]!.surfaceOp).toBe('append')
expect(contexts[index]!.data.source).toEqual({ kind: 'plugin', plugin: 'time-context' })
// `snapshot` form: one named contribution whose text is exactly what the
// model read, so a consumer attributes it without re-splitting prose.
expect(contexts[index]!.data.source).toMatchObject({
kind: 'plugin',
plugin: 'time-context',
form: 'snapshot',
sections: [{ name: 'time-context' }],
})
}
const contextText = contexts.map(event => event.data.content
.filter(block => block.type === 'text')