mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-04 16:09:05 +00:00
fix: show org create/update error without added quotes (#15323)
This commit is contained in:
@@ -229,6 +229,23 @@ describe("AddUpdateOrganization", () => {
|
||||
expect(toast).toHaveBeenCalledWith(expect.objectContaining({ variant: "error" }));
|
||||
});
|
||||
|
||||
it("shows the server message verbatim without added quotes", async () => {
|
||||
vi.spyOn(orgService, "create").mockRejectedValueOnce({
|
||||
response: { data: { message: "Organization creation failed." } },
|
||||
});
|
||||
const wrapper = mountComp();
|
||||
|
||||
await getNameInput(wrapper).setValue("Err Org");
|
||||
await submitForm(wrapper);
|
||||
|
||||
expect(toast).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
variant: "error",
|
||||
message: "Organization creation failed.",
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it("renames the organization in update mode", async () => {
|
||||
const wrapper = mountComp({ modelValue: { id: "123", name: "Acme" } });
|
||||
await getNameInput(wrapper).setValue("Acme Renamed");
|
||||
|
||||
@@ -225,12 +225,10 @@ export default defineComponent({
|
||||
toast({
|
||||
variant: "error",
|
||||
message: raw(
|
||||
JSON.stringify(
|
||||
err?.response?.data["message"] ||
|
||||
(organizationId
|
||||
? this.t("iam.addUpdateOrganization.updateFailed")
|
||||
: this.t("iam.addUpdateOrganization.createFailed")),
|
||||
),
|
||||
err?.response?.data["message"] ||
|
||||
(organizationId
|
||||
? this.t("iam.addUpdateOrganization.updateFailed")
|
||||
: this.t("iam.addUpdateOrganization.createFailed")),
|
||||
),
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user