Fixed failing tests
This commit is contained in:
parent
af3ddbf0c8
commit
9394813b4b
1 changed files with 6 additions and 2 deletions
|
|
@ -26,7 +26,7 @@ describe("Topbar.vue", () => {
|
||||||
it("renders the logo image and text", () => {
|
it("renders the logo image and text", () => {
|
||||||
const logo = wrapper.find(".layout-topbar-logo");
|
const logo = wrapper.find(".layout-topbar-logo");
|
||||||
expect(logo.exists()).toBe(true);
|
expect(logo.exists()).toBe(true);
|
||||||
expect(logo.find("img").attributes("alt")).toBe("Two stick silhouettes admiring fireworks in the sky");
|
expect(logo.find("img").attributes("alt")).toBe("Git like tree using red, white-ish and blue colours.");
|
||||||
expect(logo.text()).toContain("Glowing Fiesta");
|
expect(logo.text()).toContain("Glowing Fiesta");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -81,12 +81,16 @@ describe("Topbar.vue", () => {
|
||||||
it("updates isDarkTheme ref when toggled", async () => {
|
it("updates isDarkTheme ref when toggled", async () => {
|
||||||
const darkModeButton = wrapper.find(".layout-topbar-action-highlight");
|
const darkModeButton = wrapper.find(".layout-topbar-action-highlight");
|
||||||
|
|
||||||
|
// @ts-expect-error: it's a test accessing vm property
|
||||||
expect(wrapper.vm.isDarkTheme).toBe(false);
|
expect(wrapper.vm.isDarkTheme).toBe(false);
|
||||||
|
|
||||||
await darkModeButton.trigger("click");
|
await darkModeButton.trigger("click");
|
||||||
|
|
||||||
|
// @ts-expect-error: it's a test accessing vm property
|
||||||
expect(wrapper.vm.isDarkTheme).toBe(true);
|
expect(wrapper.vm.isDarkTheme).toBe(true);
|
||||||
|
|
||||||
await darkModeButton.trigger("click");
|
await darkModeButton.trigger("click");
|
||||||
|
// @ts-expect-error: it's a test accessing vm property
|
||||||
expect(wrapper.vm.isDarkTheme).toBe(false);
|
expect(wrapper.vm.isDarkTheme).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -123,7 +127,7 @@ describe("Topbar.vue", () => {
|
||||||
|
|
||||||
it("has correct image source", () => {
|
it("has correct image source", () => {
|
||||||
const img = wrapper.find(".layout-topbar-logo img");
|
const img = wrapper.find(".layout-topbar-logo img");
|
||||||
expect(img.attributes("src")).toContain("logo.png");
|
expect(img.attributes("src")).toContain("data:image/svg+xml");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue