Files
lucia-frontend/tests/unit/module/apiError.test.js
T

24 lines
627 B
JavaScript

// The Lucia project.
// Copyright 2026-2026 DSP, inc. All rights reserved.
// Authors:
// imacat.yang@dsp.im (imacat), 2026/07/04
// AI assistance: Claude Code (Anthropic)
import { describe, it, expect, vi } from "vitest";
import apiError from "@/module/apiError.js";
const toastDefault = vi.fn();
vi.mock("vue-toast-notification", () => ({
useToast: () => ({ default: toastDefault }),
}));
describe("apiError", () => {
it("shows the message as a toast at the bottom", () => {
apiError("some message");
expect(toastDefault).toHaveBeenCalledWith("some message", {
position: "bottom",
});
});
});