明确拼接后段循环接续的验收边界
用前段结束于循环5、后段原循环5和7应映射为6和8的场景验证接续,不额外假设首段起点。隔离复验仍复现前置缺口。
| | |
| | | |
| | | test('拼接前置行为:共同多电池、跳号和末工步缺失', async ({ page }) => { |
| | | await login(page) |
| | | // 独立测试使用未被连续演示删除的来源,并覆盖非 1 起始循环。 |
| | | const single = [selection(9302), selection(9303)] |
| | | // 后段从循环5开始,必须平移到前段末循环5之后;不额外假设首段的归零规则。 |
| | | const single = [selection(9303), selection(9302)] |
| | | const preview = (await api(page, 'splice-report/preview', 'POST', single)).data |
| | | expect.soft(preview.cycleNos, '应从 1 接续并保留段内跳号').toEqual([1, 3, 4, 6, 8]) |
| | | expect.soft(preview.segments[1].statistics['3'].finalVoltage1 ?? null, '最后实际工步缺失,不能回退到 4.2 V').toBeNull() |
| | | const nextSegment = preview.segments[1] |
| | | expect.soft(nextSegment.originalCycleNos.map((no: number) => no + nextSegment.offset), '后段应紧接前段且保留段内跳号').toEqual([6, 8]) |
| | | expect.soft(preview.segments[0].statistics['3'].finalVoltage1 ?? null, '最后实际工步缺失,不能回退到 4.2 V').toBeNull() |
| | | const multiple = await request(page, 'splice-report/preview', 'POST', [selection(9302), selection(9302, 9402), selection(9303), selection(9303, 9403)]) |
| | | expect.soft(multiple.code, `共同多电池:${multiple.msg}`).toBe(200) |
| | | const mismatch = await request(page, 'splice-report/preview', 'POST', [selection(9302), selection(9304)]) |