feat(edit): 采集插件、编辑页SKU 属性动态展示、颜色展示开发

This commit is contained in:
R524809
2026-09-22 10:11:57 +08:00
parent 05747d6f22
commit 2b06ef0692
12 changed files with 390 additions and 11 deletions
@@ -9,6 +9,7 @@ import {
extractOzonGalleryImageUrls,
extractOzonGalleryVideos,
} from '../lib/ozon-parser.ts';
import { formatCollectedDescription } from '../lib/description-format.ts';
import { dedupeImageUrl, normaliseImageUrl } from '../lib/product-media.ts';
test('Ozon gallery fixture only returns product-gallery images', async () => {
@@ -93,6 +94,15 @@ test('Ozon JSON-LD Product description is the fallback when rich content is abse
);
});
test('采集描述保留段落和列表,并为压平的 Ozon 结构标题补出换行', () => {
assert.equal(
formatCollectedDescription(
'Описание товара:适合户外使用。Характеристики:- 容量:25 L- 材质:尼龙Преимущества:- 防水\n\nКомплектация:<br>背包',
),
'Описание товара:\n适合户外使用。\n\nХарактеристики:\n- 容量:25 L\n- 材质:尼龙\n\nПреимущества:\n- 防水\n\nКомплектация:\n背包',
);
});
test('Ozon full characteristics merge with the five short header characteristics', () => {
const attributes = extractOzonCharacteristics([
{