关联订单转账凭证上传控件与可见标题

This commit is contained in:
cieanyau committed 2026-11-06 03:17:10 +08:00
1 parent bbd1f3b963
commit 4ac87fa574
2 files changed
+61 -1

No files matched your search

+57
View File
@@ -231,6 +231,63 @@ test(
}),
);
test(
"bank voucher uploads are named from the visible order heading",
{ timeout: 25000 },
(t) =>
scenario(t, {}, async (page) => {
const requests = await boundary(page, {
"/order/42": {
order: {
id: 42,
amount: "20.00",
amount_unpaid: "20.00",
credit: "0.00",
type: "new",
status: "WaitUpload",
gateway: "artificial",
create_time: 1700000000,
items: [{ id: 1, product_name: "本地测试实例", amount: "20.00" }],
},
customfields: { is_pre_invoice: 0 },
},
"/upload": { save_name: "bank-voucher.pdf" },
});
await login(page, "/orders/42");
await page
.getByRole("heading", { name: "银行转账凭证", exact: true })
.waitFor();
const input = page.locator("input[type=file]");
await input.waitFor();
const accessible = await input.ariaSnapshot();
assert.ok(
accessible.includes("银行转账凭证"),
`The visible voucher heading must name the upload field; browser accessibility tree: ${accessible}`,
);
await page.getByLabel("银行转账凭证", { exact: true }).setInputFiles({
name: "bank-voucher.pdf",
mimeType: "application/pdf",
buffer: Buffer.from("local-e2e-voucher-not-financial-data"),
});
const remove = page.getByRole("button", {
name: "移除凭证",
exact: true,
});
await remove.waitFor();
assert.deepEqual(
requests.filter((request) => request.path === "/upload"),
[{ path: "/upload", authenticated: true, multipart: true }],
);
await remove.click();
assert.equal(await remove.count(), 0);
return {
visibleHeadingNamesUpload: true,
authenticatedMultipartUpload: true,
localVoucherRemoval: true,
};
}),
);
test(
"normal kky upgrade plans and disks fit the narrow dialog container",
{ timeout: 30000 },