feat: ship v0.5.0 with auto and wizard writing modes
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { parseScenePlanJson } from '../../src/main/services/auto-parse.service'
|
||||
|
||||
describe('parseScenePlanJson', () => {
|
||||
it('parses valid scene plan', () => {
|
||||
const json = JSON.stringify({
|
||||
scenes: [
|
||||
{
|
||||
label: '开场',
|
||||
summary: '林远步入演武场,众人围观,测灵石前气氛紧张,他感受到体内灵力涌动。'
|
||||
},
|
||||
{
|
||||
label: '异变',
|
||||
summary: '测灵石突然碎裂,长老震惊,同门哗然,林远意识到自己的天赋远超预期。'
|
||||
}
|
||||
],
|
||||
estimatedWords: 3000
|
||||
})
|
||||
const plan = parseScenePlanJson(json)
|
||||
expect(plan.scenes).toHaveLength(2)
|
||||
expect(plan.estimatedWords).toBe(3000)
|
||||
})
|
||||
|
||||
it('throws on invalid JSON', () => {
|
||||
expect(() => parseScenePlanJson('not json')).toThrow()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user