feat(h5): apply fourth feedback and tighten local capture validation
This commit is contained in:
@@ -31,8 +31,20 @@ const model = SkinScore.buildViewModel(result, SkinScore.MOCK_SIDE, { realAge: 3
|
||||
const modelBefore = JSON.stringify(model), rawBefore = JSON.stringify(result);
|
||||
const presentation = ReportUI.build(model, result);
|
||||
const text = presentation.views.find(view => view.key === 'wrinkles').text;
|
||||
for (const row of details) assert(text.includes(row.name));
|
||||
assert(text.includes('标准化长度 1.2088'));
|
||||
assert.deepEqual(presentation.views.find(view => view.key === 'wrinkles').details, details);
|
||||
assert(!text.includes('分区明细') && !text.includes('标准化长度'));
|
||||
const approved = {
|
||||
'预警': '全脸共检测到皱纹 12 条、细纹 34 条,面中、口周、眼周等区域已出现静态纹倾向,纹路已呈现固化趋势,并非临时性干纹。',
|
||||
'改善': '全脸共检测到皱纹 12 条、细纹 34 条,面部整体平整,仅眼周或口周有细微的干纹,无明显静态深纹,纹路面积占比相对较低。',
|
||||
'良好': '面中、口周、眼周等各区域均无明显皱纹沟壑,无静态深纹与粗纹,各类纹路面积均处于极低水平,面部整体平整细腻。'
|
||||
};
|
||||
for (const level of Object.keys(approved)) {
|
||||
const fixture = JSON.parse(modelBefore);
|
||||
fixture.cats.wrinkles.level = level;
|
||||
fixture.cats.wrinkles.vars.wr_cnt = 12;
|
||||
fixture.cats.wrinkles.vars.fl_cnt = 34;
|
||||
assert.equal(ReportUI.build(fixture, result).views.find(view => view.key === 'wrinkles').text, approved[level]);
|
||||
}
|
||||
assert.equal(JSON.stringify(model), modelBefore);
|
||||
assert.equal(JSON.stringify(result), rawBefore);
|
||||
const excellent = JSON.parse(JSON.stringify(model));
|
||||
|
||||
Reference in New Issue
Block a user