task-273(验收反馈): 店铺数据卡片宫格排(一行3个/一页9张+卡片分页)
This commit is contained in:
@@ -6,8 +6,8 @@ import { readSource } from './helpers.ts'
|
||||
|
||||
test('align_shop_data_cards_per_task', () => {
|
||||
const page = readSource('src/pages/tasks/ShopDataTasksPage.vue')
|
||||
// 每任务一张卡:以 resultRow 迭代渲染卡片,不再按店铺聚合。
|
||||
assert.match(page, /v-for="row in allResultRows"/, '逐任务卡片渲染')
|
||||
// 每任务一张卡:以 resultRow 迭代渲染卡片(宫格分页后绑定 pagedResultRows),不再按店铺聚合。
|
||||
assert.match(page, /v-for="row in pagedResultRows"/, '逐任务卡片渲染')
|
||||
assert.doesNotMatch(page, /v-for="group in groups"/, '去掉按店铺聚合卡片')
|
||||
// 卡片结构:店铺名头 + 任务号/状态 + 分组/最新/国家/文件 信息行 + 下载文件/删除。
|
||||
assert.match(page, /任务 {{ row\.taskNo \|\| row\.resultId }}|任务 {{ row\.taskNo/, '卡片含任务号')
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readSource } from './helpers.ts'
|
||||
|
||||
// 验收反馈:店铺数据记录卡片用宫格排(一行 3 个、一页 9 张卡片)+ 分页组件翻页。
|
||||
|
||||
const PAGE = 'src/pages/tasks/ShopDataTasksPage.vue'
|
||||
|
||||
test('align_shop_data_grid_normal_primary_path', () => {
|
||||
const src = readSource(PAGE)
|
||||
assert.match(src, /grid-template-columns:\s*repeat\(3,\s*1fr\)/, '卡片容器应为 3 列宫格')
|
||||
})
|
||||
|
||||
test('align_shop_data_grid_normal_variant_input', () => {
|
||||
const src = readSource(PAGE)
|
||||
assert.match(src, /cardPageSize\s*=\s*9|pageSize\s*=\s*9/, '卡片分页每页 9 张')
|
||||
assert.match(src, /cardPage\b/, '应有卡片页状态')
|
||||
assert.match(src, /pagedResultRows|cardPageRows/, '卡片应绑定按 9 张切片的数据')
|
||||
})
|
||||
|
||||
test('align_shop_data_grid_boundary_empty_input', () => {
|
||||
// 卡片区下方有翻页组件(prev/next),与店铺分页并存。
|
||||
const src = readSource(PAGE)
|
||||
const count = (src.match(/el-pagination/g) || []).length
|
||||
assert.ok(count >= 2, '页面应含店铺分页 + 卡片分页两处 el-pagination')
|
||||
assert.match(src, /layout="prev, pager, next"/, '卡片分页含上一页/下一页')
|
||||
})
|
||||
|
||||
test('align_shop_data_grid_boundary_single_item', () => {
|
||||
// 卡片渲染绑定分页后的数组而非全量。
|
||||
const src = readSource(PAGE)
|
||||
assert.match(src, /v-for="row in pagedResultRows"/, '卡片 v-for 使用分页后数组')
|
||||
})
|
||||
|
||||
test('align_shop_data_grid_repeated_operation_is_idempotent', () => {
|
||||
// 切店铺页时卡片页重置为第一页,避免空页。
|
||||
const src = readSource(PAGE)
|
||||
assert.match(src, /cardPage\s*(?:\.value)?\s*=\s*1/, '切页需重置卡片页到 1')
|
||||
})
|
||||
@@ -10,7 +10,7 @@ test('test_task_266_view_normal_primary_path', () => {
|
||||
// 视图已改为「每条任务一张卡」(对齐 admin.js renderShopDataRecordTable)。
|
||||
const page = readSource('src/pages/tasks/ShopDataTasksPage.vue')
|
||||
assert.match(page, /shop-card-grid/, '需任务卡片网格')
|
||||
assert.match(page, /v-for="row in allResultRows"/, '逐任务渲染卡片')
|
||||
assert.match(page, /v-for="row in pagedResultRows"/, '逐任务渲染卡片')
|
||||
assert.match(page, /shop-card-task-no/, '卡片含任务号')
|
||||
assert.match(page, /暂无符合条件的店铺数据任务/, '空态文案')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user