feat: ship v0.4.0 with interactive writing mode
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { parsePlotsJson, parseNamingRequiredJson } from '../../src/main/services/interactive-parse.service'
|
||||
|
||||
describe('interactive-parse', () => {
|
||||
it('parses three plot options', () => {
|
||||
const json = `{"plots":[{"id":"A","label":"锋芒","summary":"林远展露天赋引起轰动,同门侧目,长老暗中关注其来历与隐患。"},{"id":"B","label":"藏锋","summary":"林远按长老暗示收敛灵力,被安排在外门修行,暗中调查测灵石异变。"},{"id":"C","label":"转折","summary":"测灵石碎裂引发异象,闭关太上长老出关,宗门上下震动。"}]}`
|
||||
const plots = parsePlotsJson(json)
|
||||
expect(plots).toHaveLength(3)
|
||||
expect(plots[0].summary.length).toBeGreaterThanOrEqual(10)
|
||||
})
|
||||
|
||||
it('parses naming_required payload', () => {
|
||||
const json = `{"type":"naming_required","elementType":"角色","context":"需要为新同伴命名","options":["名1","名2","名3","名4","名5"]}`
|
||||
const pause = parseNamingRequiredJson(json)
|
||||
expect(pause.options).toHaveLength(5)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user