Moved the footer into self contained component
This commit is contained in:
parent
c20396b75e
commit
8910613676
3 changed files with 65 additions and 14 deletions
51
tests/components/FooterComponent.spec.ts
Normal file
51
tests/components/FooterComponent.spec.ts
Normal 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());
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue