This commit is contained in:
2026-10-19 02:34:50 +07:00
parent 06af1e047d
commit e2f8a3302e
15 changed files with 109 additions and 32 deletions
+17
View File
@@ -22,3 +22,20 @@ test('план: режимы protobuf, значения по умолчанию
])
assert.throws(() => parsePlan(value))
})
test('старые текстовые режимы преобразуются без изменения порядка и текущего шага', () => {
const plan = parsePlan({
steps: [3, 'SCREEN_MODE_INTRO_DONE', 5, 'SCREEN_MODE_CONCLUSION_DONE'].map((mode) => ({
mode,
text: 'Неиспользуемый текст',
})),
currentStep: 2,
})
assert.equal(plan.currentStep, 2)
assert.deepEqual(plan.steps.map(({ mode, text }) => ({ mode, text })), [
{ mode: 8, text: 'Успехов' },
{ mode: 8, text: 'Успехов' },
{ mode: 8, text: 'Спасибо за игру!' },
{ mode: 8, text: 'Спасибо за игру!' },
])
})