fix payment qr fallback and admin guidance
This commit is contained in:
@@ -155,6 +155,8 @@ vi.mock("vue-i18n", async () => {
|
||||
"admin.settings.payment.findProvider": "查看支持的支付方式",
|
||||
"admin.settings.openaiExperimentalScheduler.title": "OpenAI 实验调度策略",
|
||||
"admin.settings.openaiExperimentalScheduler.description": "默认关闭。开启后仅影响本网关在 OpenAI 账号间的实验性调度选择逻辑,不代表上游 OpenAI 官方能力。",
|
||||
"admin.settings.site.uploadImage": "上传图片",
|
||||
"admin.settings.site.remove": "移除",
|
||||
};
|
||||
return {
|
||||
...actual,
|
||||
@@ -240,6 +242,37 @@ const SelectStub = defineComponent({
|
||||
},
|
||||
});
|
||||
|
||||
const ImageUploadStub = defineComponent({
|
||||
props: {
|
||||
modelValue: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
uploadLabel: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
removeLabel: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
return () =>
|
||||
h("div", {
|
||||
class: "image-upload-stub",
|
||||
"data-model-value": props.modelValue,
|
||||
"data-upload-label": props.uploadLabel,
|
||||
"data-remove-label": props.removeLabel,
|
||||
"data-placeholder": props.placeholder,
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
const baseSettingsResponse = {
|
||||
registration_enabled: true,
|
||||
email_verify_enabled: false,
|
||||
@@ -375,7 +408,7 @@ function mountView() {
|
||||
GroupBadge: true,
|
||||
GroupOptionItem: true,
|
||||
ProxySelector: true,
|
||||
ImageUpload: true,
|
||||
ImageUpload: ImageUploadStub,
|
||||
BackupSettings: true,
|
||||
},
|
||||
},
|
||||
@@ -582,7 +615,7 @@ describe("admin SettingsView payment visible method controls", () => {
|
||||
GroupBadge: true,
|
||||
GroupOptionItem: true,
|
||||
ProxySelector: true,
|
||||
ImageUpload: true,
|
||||
ImageUpload: ImageUploadStub,
|
||||
BackupSettings: true,
|
||||
},
|
||||
},
|
||||
@@ -608,6 +641,24 @@ describe("admin SettingsView payment visible method controls", () => {
|
||||
);
|
||||
expect(wrapper.text()).not.toContain("OpenAI 高级调度器");
|
||||
});
|
||||
|
||||
it("passes translated upload and remove labels to the payment help image uploader", async () => {
|
||||
const wrapper = mountView();
|
||||
|
||||
await flushPromises();
|
||||
await openPaymentTab(wrapper);
|
||||
|
||||
const imageUploads = wrapper.findAll(".image-upload-stub");
|
||||
expect(imageUploads.length).toBeGreaterThan(0);
|
||||
|
||||
const paymentHelpImageUpload = imageUploads.find(
|
||||
(node) => node.attributes("data-placeholder") === "admin.settings.payment.helpImagePlaceholder",
|
||||
);
|
||||
|
||||
expect(paymentHelpImageUpload).toBeDefined();
|
||||
expect(paymentHelpImageUpload?.attributes("data-upload-label")).toBe("上传图片");
|
||||
expect(paymentHelpImageUpload?.attributes("data-remove-label")).toBe("移除");
|
||||
});
|
||||
});
|
||||
|
||||
describe("admin SettingsView wechat connect controls", () => {
|
||||
|
||||
Reference in New Issue
Block a user