Code smells fixes

This commit is contained in:
Liviu Burcusel 2025-09-23 18:00:07 +02:00
parent 3fcb150636
commit 910302f27a
Signed by: liviu
GPG key ID: 6CDB37A4AD2C610C
3 changed files with 15 additions and 15 deletions

View file

@ -5,7 +5,7 @@ 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');
globalThis.ResizeObserver = require('resize-observer-polyfill');
const vuetify = createVuetify({
components,

View file

@ -6,7 +6,7 @@ import * as components from 'vuetify/components'
import * as directives from 'vuetify/directives'
import HeaderNavBar from "../../src/components/HeaderNavBar.vue"
global.ResizeObserver = require('resize-observer-polyfill');
globalThis.ResizeObserver = require('resize-observer-polyfill');
// Mock routes for testing
const routes = [
@ -100,17 +100,17 @@ describe("HeaderNavBar", () => {
it("has correct button styling classes", () => {
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("text-decoration-none")
});
}
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("-primary");
});
}
});
it("has proper app bar structure", () => {
@ -127,12 +127,12 @@ describe("HeaderNavBar", () => {
it("maintains accessibility attributes", () => {
const homeButton = wrapper.find("[data-role='homeNavigation']");
expect(homeButton.attributes("data-role")).toBe('homeNavigation');
// Check that buttons are actual button elements for screen readers
const buttons = wrapper.findAll("button")
expect(buttons).toHaveLength(2)
buttons.forEach((button: any) => {
const buttons = wrapper.findAll("button");
expect(buttons).toHaveLength(2);
for (const button of buttons) {
expect(button.element.tagName).toBe("BUTTON");
})
})
})
}
});
});