关联订单转账凭证上传控件与可见标题
This commit is contained in:
1 parent
bbd1f3b963
commit
4ac87fa574
2 files changed
+61
-1
No files matched your search
@@ -990,7 +990,9 @@ var ue = {
|
||||
(a[16] ||=
|
||||
createElementVNode(
|
||||
`h3`,
|
||||
null,
|
||||
{
|
||||
id: `bank-voucher-label`,
|
||||
},
|
||||
`银行转账凭证`,
|
||||
-1,
|
||||
)),
|
||||
@@ -1054,6 +1056,7 @@ var ue = {
|
||||
`input`,
|
||||
{
|
||||
id: `bank-voucher-files`,
|
||||
"aria-labelledby": `bank-voucher-label`,
|
||||
type: `file`,
|
||||
accept: `image/*,.pdf`,
|
||||
multiple: ``,
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in new issue
Block a user