diff --git a/admin-frontend-vue/src/pages/asin/SkipPricePage.vue b/admin-frontend-vue/src/pages/asin/SkipPricePage.vue new file mode 100644 index 00000000..e86e836f --- /dev/null +++ b/admin-frontend-vue/src/pages/asin/SkipPricePage.vue @@ -0,0 +1,395 @@ + + + + + diff --git a/admin-frontend-vue/tests/task-258.test.ts b/admin-frontend-vue/tests/task-258.test.ts new file mode 100644 index 00000000..134592ba --- /dev/null +++ b/admin-frontend-vue/tests/task-258.test.ts @@ -0,0 +1,57 @@ +import test from 'node:test' +import assert from 'node:assert/strict' +import { readSource } from './helpers.ts' + +// module 13 task 258:最低价ASIN页对齐 admin panel-skip-price-asin —— 价格范围筛选生效、 +// 行内「配置」抽屉(逐国 ASIN+最低价,留空=删除、低价必带 ASIN 校验)、导入添加/删除导入/导出。 + +test('test_task_258_skipprice_normal_primary_path', () => { + const page = readSource('src/pages/asin/SkipPricePage.vue') + assert.match(page, /updateSkipPriceCountry/, '需接线逐国 PUT(ASIN+最低价)') + assert.match(page, /deleteSkipPriceCountry/, '需接线逐国 DELETE') + assert.match(page, /配置/, '行内需配置入口') + assert.match(page, /留空表示删除该站点/, '抽屉需留空删除语义') +}) + +test('test_task_258_skipprice_normal_variant_input', () => { + const page = readSource('src/pages/asin/SkipPricePage.vue') + assert.match(page, /填写最低价时必须填写 ASIN/, '低价必带 ASIN 校验文案') + assert.match(page, /最低价格式不正确/, '低价格式校验文案') + assert.match(page, /导入添加/, '页头导入添加') + assert.match(page, /导入删除/, '页头删除导入') + assert.match(page, /导出/, '页头导出') +}) + +test('test_task_258_skipprice_normal_repeated_operation_is_idempotent', () => { + const page = readSource('src/pages/asin/SkipPricePage.vue') + assert.ok(page.includes('配置')) + assert.ok(page.includes('最低价')) +}) + +test('test_task_258_skipprice_boundary_empty_input', () => { + const page = readSource('src/pages/asin/SkipPricePage.vue') + assert.match(page, /startSkipPriceImport|fetchSkipPriceImportProgress/, '需接线导入添加') + assert.match(page, /toUpperCase/, 'ASIN 需自动大写') + assert.match(page, /minimumPriceFrom/, '价格范围筛选需保留') +}) + +test('test_task_258_skipprice_boundary_single_item', () => { + const page = readSource('src/pages/asin/SkipPricePage.vue') + assert.match(page, /请选择分组|分组后再导入/, '导入需分组必选(后端必填)') +}) + +test('test_task_258_skipprice_boundary_limit_or_missing_field', () => { + const api = readSource('src/pages/asin/skip-price-detail-api.ts') + assert.match(api, /minimumPrice/, '详情 API 需含最低价') +}) + +test('test_task_258_skipprice_invalid_input_rejected', () => { + const page = readSource('src/pages/asin/SkipPricePage.vue') + assert.match(page, /批量删除|确定按 Excel/, '删除导入需前置确认') + assert.match(page, /skip-price-asins\/export|导出/, '需导出能力') +}) + +test('test_task_258_skipprice_dependency_failure_returns_actionable_message', () => { + const page = readSource('src/pages/asin/SkipPricePage.vue') + assert.match(page, /toSkipPriceParams/, '筛选需含最低价区间归一') +})