test: verify order driven configuration lifecycle

This commit is contained in:
abaishu0730 committed 2026-10-20 11:44:11 +08:00
1 parent b9dae75f4a
commit 4f89c4765f
18 files changed
+134 -31

No files matched your search

@@ -20,3 +20,5 @@ test('concurrent changes to the same rule field block save until explicitly reso
test('ambiguous fields can be selected directly in the rule and remain an unsaved mapping edit',{timeout:90000},async t=>{
const {page,runtime,capture}=await orderDrivenUI(t,'#order-rules');capture({taskId:'amb',serialNum:'AMB',fields:{one:'148396',two:'HA148396'}},{one:'订单号',two:'订单号'});await page.locator('[data-rule-id="bs-change"]').click();await page.getByRole('button',{name:'选择订单 AMB',exact:true}).click();await page.locator('#rule-order-recognition').getByRole('button',{name:'订单号 · 148396',exact:true}).click();await page.locator('#rule-inline-mapping #fm-orderNo').waitFor({state:'attached'});await page.locator('#rule-inline-mapping #fm-recognition [data-recognition-field="orderNo"]').getByText('148396',{exact:true}).waitFor();assert.deepEqual(runtime.orderRules.all('field-mapping-drafts'),[]);assert.equal(await page.evaluate(()=>PageLifecycle.dirty()),true);
});
test('cancelling an order clears the formal check selection and keeps the rule clean',{timeout:90000},async t=>{const {page}=await orderDrivenUI(t,'#order-rules');await page.locator('[data-rule-id="bs-change"]').click();await page.getByRole('button',{name:'选择订单 S-1',exact:true}).click();await page.locator('#rule-order-recognition').getByText('148396',{exact:true}).waitFor();await page.getByRole('button',{name:'取消选择',exact:true}).click();assert.equal(await page.locator('#order-rule-sample-source').inputValue(),'');assert.equal(await page.locator('#order-rule-preview-result').innerText(),'');assert.equal(await page.evaluate(()=>PageLifecycle.dirty()),false);});