51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
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());
|
|
});
|
|
|
|
});
|