parent
7b34c27290
commit
0cec9f5afd
123 changed files with 4685 additions and 3607 deletions
|
|
@ -1,11 +1,38 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { mount, type VueWrapper } from "@vue/test-utils";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { mount } from "@vue/test-utils";
|
||||
import DefaultLayout from "~/layouts/Default.vue";
|
||||
|
||||
describe("Default.vue", () => {
|
||||
const wrapper: VueWrapper = mount(DefaultLayout, {});
|
||||
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");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue