Code smells fixes
This commit is contained in:
parent
3fcb150636
commit
910302f27a
3 changed files with 15 additions and 15 deletions
|
|
@ -5,7 +5,7 @@ import * as components from "vuetify/components";
|
||||||
import * as directives from "vuetify/directives";
|
import * as directives from "vuetify/directives";
|
||||||
import FooterComponent from "../../src/components/FooterComponent.vue";
|
import FooterComponent from "../../src/components/FooterComponent.vue";
|
||||||
|
|
||||||
global.ResizeObserver = require('resize-observer-polyfill');
|
globalThis.ResizeObserver = require('resize-observer-polyfill');
|
||||||
|
|
||||||
const vuetify = createVuetify({
|
const vuetify = createVuetify({
|
||||||
components,
|
components,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import * as components from 'vuetify/components'
|
||||||
import * as directives from 'vuetify/directives'
|
import * as directives from 'vuetify/directives'
|
||||||
import HeaderNavBar from "../../src/components/HeaderNavBar.vue"
|
import HeaderNavBar from "../../src/components/HeaderNavBar.vue"
|
||||||
|
|
||||||
global.ResizeObserver = require('resize-observer-polyfill');
|
globalThis.ResizeObserver = require('resize-observer-polyfill');
|
||||||
|
|
||||||
// Mock routes for testing
|
// Mock routes for testing
|
||||||
const routes = [
|
const routes = [
|
||||||
|
|
@ -101,16 +101,16 @@ describe("HeaderNavBar", () => {
|
||||||
it("has correct button styling classes", () => {
|
it("has correct button styling classes", () => {
|
||||||
const routerLinks = wrapper.findAllComponents({ name: "RouterLink" });
|
const routerLinks = wrapper.findAllComponents({ name: "RouterLink" });
|
||||||
|
|
||||||
routerLinks.forEach((link: any) => {
|
for (const link of routerLinks) {
|
||||||
expect(link.classes()).toContain("mx-2")
|
expect(link.classes()).toContain("mx-2")
|
||||||
expect(link.classes()).toContain("text-decoration-none")
|
expect(link.classes()).toContain("text-decoration-none")
|
||||||
});
|
}
|
||||||
|
|
||||||
const buttons = wrapper.findAllComponents({ name: "v-btn" });
|
const buttons = wrapper.findAllComponents({ name: "v-btn" });
|
||||||
buttons.forEach((button: any) => {
|
for (const button of buttons) {
|
||||||
expect(button.attributes("class")).toContain("v-btn--size-large");
|
expect(button.attributes("class")).toContain("v-btn--size-large");
|
||||||
expect(button.attributes("class")).toContain("-primary");
|
expect(button.attributes("class")).toContain("-primary");
|
||||||
});
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it("has proper app bar structure", () => {
|
it("has proper app bar structure", () => {
|
||||||
|
|
@ -129,10 +129,10 @@ describe("HeaderNavBar", () => {
|
||||||
expect(homeButton.attributes("data-role")).toBe('homeNavigation');
|
expect(homeButton.attributes("data-role")).toBe('homeNavigation');
|
||||||
|
|
||||||
// Check that buttons are actual button elements for screen readers
|
// Check that buttons are actual button elements for screen readers
|
||||||
const buttons = wrapper.findAll("button")
|
const buttons = wrapper.findAll("button");
|
||||||
expect(buttons).toHaveLength(2)
|
expect(buttons).toHaveLength(2);
|
||||||
buttons.forEach((button: any) => {
|
for (const button of buttons) {
|
||||||
expect(button.element.tagName).toBe("BUTTON");
|
expect(button.element.tagName).toBe("BUTTON");
|
||||||
})
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ describe("Vuetify Plugin Configuration", () => {
|
||||||
|
|
||||||
const expectedKeys = ["components", "directives", "theme"];
|
const expectedKeys = ["components", "directives", "theme"];
|
||||||
const actualKeys = Object.keys(callArgs);
|
const actualKeys = Object.keys(callArgs);
|
||||||
expect(actualKeys.sort()).toEqual(expectedKeys.sort());
|
expect([...actualKeys].sort((a, b) => a.localeCompare(b))).toEqual([...expectedKeys].sort((a, b) => a.localeCompare(b)));
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should export the vuetify instance", async () => {
|
it("should export the vuetify instance", async () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue