glowing-fiesta-original/tests/layouts/Default.test.ts
Liviu Burcusel 671baaf079
All checks were successful
Production Build and Deploy / Build (pull_request) Successful in 56s
Production Build and Deploy / Deploy (pull_request) Successful in 28s
GF-4 (#4) Finalized layout
2025-12-22 15:06:44 +01:00

38 lines
1.2 KiB
TypeScript

import { afterEach, describe, expect, it, vi } from "vitest";
import { mount } from "@vue/test-utils";
import DefaultLayout from "~/layouts/Default.vue";
describe("Default.vue", () => {
afterEach(() => {
vi.useRealTimers();
});
it("loads without crashing", () => {
const wrapper = mount(DefaultLayout);
expect(wrapper.exists()).toBe(true);
});
describe("Footer", () => {
it("footer is displayed", () => {
const wrapper = mount(DefaultLayout);
const footer = wrapper.find("[data-testid='footer']");
expect(footer.exists()).toBe(true);
});
it("footer shows only 2025 when current year is 2025", () => {
vi.useFakeTimers();
vi.setSystemTime(new Date(2025, 0, 1));
const wrapper = mount(DefaultLayout);
const footer = wrapper.find("[data-testid='footer']");
expect(footer.text()).toBe("Glowing Fiesta 2025");
});
it("footer shows range when current year is not 2025", () => {
vi.useFakeTimers();
vi.setSystemTime(new Date(2069, 0, 1));
const wrapper = mount(DefaultLayout);
const footer = wrapper.find("[data-testid='footer']");
expect(footer.text()).toBe("Glowing Fiesta 2025 - 2069");
});
});
});