GF-3 - Added shadcn

This commit is contained in:
Liviu Burcusel 2025-12-20 15:38:46 +01:00
parent f12adba733
commit 2ed0a69e70
Signed by: liviu
GPG key ID: 6CDB37A4AD2C610C
15 changed files with 698 additions and 11 deletions

View file

@ -0,0 +1,31 @@
import { describe, it, expect, vi } from "vitest";
import { provideSSRWidth } from "@vueuse/core";
// Mock @vueuse/core
vi.mock("@vueuse/core", () => ({
provideSSRWidth: vi.fn(),
}));
describe("SSR Width Plugin", () => {
it("should call provideSSRWidth with 1024 and vueApp", async () => {
// Mock global defineNuxtPlugin
vi.stubGlobal("defineNuxtPlugin", (plugin: any) => plugin);
// Dynamic import to ensure global is set first
const { default: plugin } = await import("~/plugins/50-ssr-width");
const mockVueApp = {};
const mockNuxtApp = {
vueApp: mockVueApp,
};
// The plugin default export is the function passed to defineNuxtPlugin
// because of our mock above.
plugin(mockNuxtApp);
expect(provideSSRWidth).toHaveBeenCalledTimes(1);
expect(provideSSRWidth).toHaveBeenCalledWith(1024, mockVueApp);
vi.unstubAllGlobals();
});
});