Project import from github
All checks were successful
Production Build and Deploy / Build (push) Successful in 1m7s
Production Build and Deploy / Deploy (push) Successful in 21s

This commit is contained in:
Liviu Burcusel 2026-01-14 16:29:05 +01:00
commit 0add58254d
Signed by: liviu
GPG key ID: 6CDB37A4AD2C610C
179 changed files with 23756 additions and 0 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();
});
});