%<\/span>/g)];
assert.equal(units.length, 7);
units.forEach(({ index }) => {
assert.ok(page.lastIndexOf('', index) > page.lastIndexOf("
{
const validationBlock = api.slice(
api.indexOf("export function validateProductDiagnosisIterationStepOne"),
api.indexOf("export function validatePromotionEffectOptimizationStepOne")
);
assert.equal((validationBlock.match(/skipErrorMessage:\s*true/g) || []).length, 3);
assert.match(api, /throw new Error\("正面、中性、负面评论占比之和应为100%。"\)/);
assert.match(page, /function diagnosisErrorMessage[\s\S]*?Request failed with status code/);
assert.match(page, /validateStepTwo[\s\S]*?diagnosisErrorMessage\(error/);
});
test("第二步草稿保存完整分析状态并在重新进入页面后恢复", () => {
assert.match(page, /function buildStepTwo\(\)[\s\S]*?totalComments: commentPreview\.value\.totalComments[\s\S]*?analysisResult: analysisResult\.value/);
assert.match(page, /function buildStepTwoValidationPayload/);
assert.match(page, /validateProductDiagnosisIterationStepTwo\(buildStepTwoValidationPayload\(data\)\)/);
assert.match(page, /function restoreStepTwo\(stepTwo\)[\s\S]*?rootCauseAnalysis\.value = stepTwo\.rootCauseAnalysis/);
assert.match(page, /analysisResult\.value = \{ sourceFileName, totalComments, positiveCount, neutralCount, negativeCount/);
assert.match(page, /restoreStepTwo\(parseSavedStep\(answer\?\.step2Answer\)\)/);
assert.doesNotMatch(page, /if \(stepTwo\.sourceFileName\)/);
});
|