- Consumes: `setupWxMock(globalThis)` from `tabIndex/tests/menuTestHelpers.mjs`; existing dynamic imports of `menuSyncHelpers.js` and `menu/context.js`.
- Produces: the standalone `menuSync.test.mjs` and `npm run test:tabIndex` execute without `wx is not defined`; the original global `wx` value is restored after the suite.
-[]**Step 1: Verify the existing test is RED**
Run:
```powershell
node --test tabIndex/tests/menuSync.test.mjs
```
Expected: FAIL at `config.js:26` with `ReferenceError: wx is not defined` while dynamically importing `menu/context.js`.
-[]**Step 2: Add the existing repository wx mock lifecycle**
Update the test imports and suite setup:
```js
import{describe,it,after}from'node:test'
importassertfrom'node:assert/strict'
import{setupWxMock}from'./menuTestHelpers.mjs'
constglobalRef=globalThis
constoriginalWx=globalRef.wx
describe('tabIndex menuSyncHelpers',async()=>{
setupWxMock(globalRef)
after(()=>{
globalRef.wx=originalWx
})
// keep the existing dynamic imports and assertions unchanged
})
```
Do not change `config.js`, `menu/context.js`, `menu/policies.js` or `menu/constants.js`; the failure is missing test environment setup, and peer `tabIndexMenu.test.mjs` already establishes this pattern.
-[]**Step 3: Run the focused test and verify GREEN**
```powershell
node --test tabIndex/tests/menuSync.test.mjs
```
Expected: PASS, 3 tests and 1 suite, with no `wx is not defined`.
-[]**Step 4: Run the TabIndex suite**
```powershell
npm run test:tabIndex
```
Expected: exit `0` with no failing suites.
-[]**Step 5: Commit the baseline fix**
```powershell
git add -- tabIndex/tests/menuSync.test.mjs
git commit -m "test: 补齐菜单同步 wx 环境"
```
---
---
...
@@ -70,23 +140,16 @@ The first input deliberately uses `salesType: 2` to prove that read-only respons
...
@@ -70,23 +140,16 @@ The first input deliberately uses `salesType: 2` to prove that read-only respons
-[]**Step 2: Write failing精品 UI contract tests**
-[]**Step 2: Write failing精品 UI contract tests**
Extend `customerDailyFields.ui.test.mjs` with list JS/WXML reads and assertions:
Extend `customerDailyFields.ui.test.mjs` with the user-visible list WXML contract; helper behavior remains covered by Step 1 rather than source-text assertions against page JavaScript:
```js
```js
it('IT-WO-DAILY-UI-005: list, detail and confirm reuse response display state',()=>{
it('IT-WO-DAILY-UI-005: list, detail and confirm reuse response display state',()=>{
Expected: FAIL because both WXML files, JS handlers and Sass selectors still contain the clear action.
Expected: FAIL because both WXML files still render the clear action.
-[]**Step 4: Remove the精品 clear action**
-[]**Step 4: Remove the精品 clear action**
...
@@ -471,7 +520,7 @@ Expected: exit `0`; all create-order, root, dynamic-form, tab-index and equity t
...
@@ -471,7 +520,7 @@ Expected: exit `0`; all create-order, root, dynamic-form, tab-index and equity t
-[]**Step 2: Check formatting and whitespace errors**
-[]**Step 2: Check formatting and whitespace errors**
```powershell
```powershell
git diff HEAD~3 --check
git diff HEAD~4 --check
```
```
Expected: no output and exit `0`.
Expected: no output and exit `0`.
...
@@ -489,17 +538,18 @@ Expected: the first command finds both list/detail adapters; the second command
...
@@ -489,17 +538,18 @@ Expected: the first command finds both list/detail adapters; the second command
```powershell
```powershell
git status --short
git status --short
git diff HEAD~3 --stat
git diff HEAD~4 --stat
```
```
Expected: only the pre-existing untracked `outputs/` and `packageDynamicForm/tests/__pycache__/` remain outside the committed feature scope; the diff contains only files listed in this plan.
Expected: only the pre-existing untracked `outputs/` and `packageDynamicForm/tests/__pycache__/` remain outside the committed feature scope; the diff contains only files listed in this plan, and the previously failing TabIndex suite is green.
-[]**Step 5: Re-read acceptance criteria**
-[]**Step 5: Re-read acceptance criteria**
Confirm all five statements against code and fresh test evidence:
Confirm all six statements against code and fresh test evidence:
1. 精品列表 reads `customer.customerTags` and `customer.actualDeliveryDate` through the display helper.
1. 精品列表 reads `customer.customerTags` and `customer.actualDeliveryDate` through the display helper.
2. 权益列表 reads top-level `customerTags` and `actualDeliveryDate` through the display helper.
2. 权益列表 reads top-level `customerTags` and `actualDeliveryDate` through the display helper.
3. 精品详情/确认 and权益详情 hide each row independently when its normalized value is empty.
3. 精品详情/确认 and权益详情 hide each row independently when its normalized value is empty.
4. Both create popups retain cancel/confirm and contain no clear action.
4. Both create popups retain cancel/confirm and contain no clear action.
5. Create/edit submission visibility and payload code was not changed.
5. Create/edit submission visibility and payload code was not changed.
6.`menuSync.test.mjs`, `npm run test:tabIndex` and complete `npm test` no longer report `wx is not defined`.