Moved the footer into self contained component

This commit is contained in:
Liviu Burcusel 2025-09-16 14:26:10 +02:00
parent c20396b75e
commit 8910613676
Signed by: liviu
GPG key ID: 6CDB37A4AD2C610C
3 changed files with 65 additions and 14 deletions

View file

@ -0,0 +1,51 @@
import { describe, it, expect, beforeEach } from "vitest";
import { mount } from "@vue/test-utils";
import { createVuetify } from "vuetify";
import * as components from "vuetify/components";
import * as directives from "vuetify/directives";
import FooterComponent from "../../src/components/FooterComponent.vue";
global.ResizeObserver = require('resize-observer-polyfill');
const vuetify = createVuetify({
components,
directives,
})
describe("FooterComponent", () => {
let wrapper: any;
beforeEach(() => {
wrapper = mount({
template: `
<v-app>
<v-layout>
<FooterComponent />
</v-layout>
</v-app>
`,
}, {
global: {
components: {
FooterComponent,
},
plugins: [vuetify]
}
})
});
it("renders the component", () => {
expect(wrapper.exists()).toBe(true);
expect(wrapper.findComponent({ name: "VFooter" }).exists()).toBe(true);
});
it("has the correct content", () => {
expect(wrapper.findComponent({ name: "VFooter" }).findAll("div")).toHaveLength(2);
expect(wrapper.findComponent({ name: "VDivider"}).exists()).toBe(true);
});
it("contains current year", () => {
expect(wrapper.text()).toContain(new Date().getFullYear());
});
});