feat: 商品单个的展示
This commit is contained in:
@@ -6,6 +6,10 @@ const source = await readFile(
|
||||
resolve("src/pages/ChatMain/ChatLongAnswer/ParsedValueView.vue"),
|
||||
"utf8"
|
||||
);
|
||||
const styleSource = await readFile(
|
||||
resolve("src/pages/ChatMain/ChatLongAnswer/styles/ParsedValueView.scss"),
|
||||
"utf8"
|
||||
);
|
||||
|
||||
const forbiddenCompatibilitySnippets = [
|
||||
"valueObj.image_url",
|
||||
@@ -80,6 +84,52 @@ for (const snippet of requiredStrictRenderingSnippets) {
|
||||
);
|
||||
}
|
||||
|
||||
const requiredSingleCommodityOverviewSnippets = [
|
||||
':scroll-x="!isSingleCommodity"',
|
||||
"'overview-combo-card': isSingleCommodity",
|
||||
'v-if="isSingleCommodity"',
|
||||
'class="overview-combo-body"',
|
||||
'class="overview-combo-cover"',
|
||||
'class="overview-combo-info"',
|
||||
'class="overview-combo-name"',
|
||||
'class="overview-combo-desc"',
|
||||
'class="overview-combo-price"',
|
||||
'class="overview-combo-currency"',
|
||||
'class="overview-combo-button"',
|
||||
];
|
||||
|
||||
for (const snippet of requiredSingleCommodityOverviewSnippets) {
|
||||
assert.equal(
|
||||
source.includes(snippet),
|
||||
true,
|
||||
`ParsedValueView single commodity should use overview combo layout: ${snippet}`
|
||||
);
|
||||
}
|
||||
|
||||
const requiredSingleCommodityOverviewStyleSnippets = [
|
||||
".overview-combo-card",
|
||||
".overview-combo-body",
|
||||
"display: flex;",
|
||||
".overview-combo-cover",
|
||||
"width: 78px;",
|
||||
"height: 78px;",
|
||||
".overview-combo-info",
|
||||
".overview-combo-name",
|
||||
".overview-combo-desc",
|
||||
".overview-combo-price",
|
||||
".overview-combo-currency",
|
||||
".overview-combo-button",
|
||||
"height: 40px;",
|
||||
];
|
||||
|
||||
for (const snippet of requiredSingleCommodityOverviewStyleSnippets) {
|
||||
assert.equal(
|
||||
styleSource.includes(snippet),
|
||||
true,
|
||||
`ParsedValueView single commodity should define overview combo style: ${snippet}`
|
||||
);
|
||||
}
|
||||
|
||||
const removedInnerSpecialEntrySnippets = [
|
||||
"createSpecialFieldEntry",
|
||||
"entry.type === 'question-suggest'",
|
||||
|
||||
Reference in New Issue
Block a user