Refactor Header module
This commit is contained in:
18
components/Header/Header.spec.js
Normal file
18
components/Header/Header.spec.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import { mount, RouterLinkStub } from "@vue/test-utils";
|
||||
import Header from "./";
|
||||
|
||||
describe("Header", () => {
|
||||
it("should render Header instance", () => {
|
||||
const wrapper = mount(Header, { stubs: ["router-link"] });
|
||||
expect(wrapper.find("h1").text()).toBe("Ghibli");
|
||||
});
|
||||
|
||||
it("should redirect to Home page when clicking on brand logo", () => {
|
||||
const wrapper = mount(Header, {
|
||||
stubs: {
|
||||
RouterLink: RouterLinkStub
|
||||
}
|
||||
});
|
||||
expect(wrapper.findComponent(RouterLinkStub).props().to).toBe("/");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user