From d745271685402b55aaa3ee85b33b76fd4f4ae3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E8=87=AA=E8=BE=BE?= <980324341@qq.com> Date: Sat, 5 Sep 2026 21:32:57 +0800 Subject: [PATCH] =?UTF-8?q?task-257(admin.html=E8=A7=82=E6=84=9F=E5=AF=B9?= =?UTF-8?q?=E9=BD=90):=20=E6=9F=A5=E8=AF=A2ASIN=E9=A1=B5=E5=AF=B9=E9=BD=90?= =?UTF-8?q?=EF=BC=88=E8=A1=8C=E5=86=85=E9=85=8D=E7=BD=AE=E6=8A=BD=E5=B1=89?= =?UTF-8?q?=E9=80=90=E5=9B=BDASIN/=E5=AF=BC=E5=85=A5=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=AF=BC=E5=85=A5/=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/pages/asin/QueryAsinPage.vue | 353 ++++++++++++++++++ admin-frontend-vue/tests/task-257.test.ts | 56 +++ 2 files changed, 409 insertions(+) create mode 100644 admin-frontend-vue/src/pages/asin/QueryAsinPage.vue create mode 100644 admin-frontend-vue/tests/task-257.test.ts diff --git a/admin-frontend-vue/src/pages/asin/QueryAsinPage.vue b/admin-frontend-vue/src/pages/asin/QueryAsinPage.vue new file mode 100644 index 00000000..06d80892 --- /dev/null +++ b/admin-frontend-vue/src/pages/asin/QueryAsinPage.vue @@ -0,0 +1,353 @@ + + + + + diff --git a/admin-frontend-vue/tests/task-257.test.ts b/admin-frontend-vue/tests/task-257.test.ts new file mode 100644 index 00000000..d74cdc83 --- /dev/null +++ b/admin-frontend-vue/tests/task-257.test.ts @@ -0,0 +1,56 @@ +import test from 'node:test' +import assert from 'node:assert/strict' +import { readSource } from './helpers.ts' + +// module 13 task 257:查询ASIN页对齐 admin panel-query-asin —— 行内「配置」抽屉(逐国 ASIN, +// 留空=删除该站点)、导入添加/删除导入/导出接线既有孤儿模块。 + +test('test_task_257_queryasin_normal_primary_path', () => { + const page = readSource('src/pages/asin/QueryAsinPage.vue') + assert.match(page, /updateQueryAsinCountryAsin/, '需接线逐国 PUT') + assert.match(page, /deleteQueryAsinCountryAsin/, '需接线逐国 DELETE') + assert.match(page, /配置/, '行内需有配置入口') + assert.match(page, /留空表示删除该站点已有的 ASIN/, '抽屉需留空=删除语义提示') +}) + +test('test_task_257_queryasin_normal_variant_input', () => { + const page = readSource('src/pages/asin/QueryAsinPage.vue') + assert.match(page, /导入添加/, '页头需导入添加') + assert.match(page, /导入删除/, '页头需删除导入') + assert.match(page, /导出/, '页头需导出') +}) + +test('test_task_257_queryasin_normal_repeated_operation_is_idempotent', () => { + const page = readSource('src/pages/asin/QueryAsinPage.vue') + assert.ok(page.includes('配置')) + assert.ok(page.includes('配置')) +}) + +test('test_task_257_queryasin_boundary_empty_input', () => { + const page = readSource('src/pages/asin/QueryAsinPage.vue') + assert.match(page, /startQueryAsinImport|startQueryAsinDeleteImport|fetchQueryAsinImportProgress|fetchQueryAsinDeleteImportProgress/, '导入需启动+轮询') + assert.match(page, /isAllowedExcelImportFile|isAllowedImportFile/, '导入需 Excel 校验') +}) + +test('test_task_257_queryasin_boundary_single_item', () => { + const page = readSource('src/pages/asin/QueryAsinPage.vue') + assert.match(page, /toUpperCase/, 'ASIN 需自动大写') + assert.match(page, /query-asins\/export|export/, '需导出能力') +}) + +test('test_task_257_queryasin_boundary_limit_or_missing_field', () => { + const api = readSource('src/pages/asin/query-asin-detail-api.ts') + assert.match(api, /\/countries\//, '详情 API 需按国家细分') + assert.match(api, /method: 'PUT'|\.put { + const page = readSource('src/pages/asin/QueryAsinPage.vue') + assert.match(page, /请选择|文件/, '导入需分组/文件必填提示') + assert.match(page, /确定按 Excel|批量删除/, '删除导入需前置确认') +}) + +test('test_task_257_queryasin_dependency_failure_returns_actionable_message', () => { + const page = readSource('src/pages/asin/QueryAsinPage.vue') + assert.match(page, /drawer|el-drawer/, '配置承载宜用抽屉') +})