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 FooterComponent from "../../src/components/FooterComponent.vue";
|
||||
|
||||
global.ResizeObserver = require('resize-observer-polyfill');
|
||||
globalThis.ResizeObserver = require('resize-observer-polyfill');
|
||||
|
||||
const vuetify = createVuetify({
|
||||
components,
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
})
|
||||
})
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ describe("Vuetify Plugin Configuration", () => {
|
|||
|
||||
const expectedKeys = ["components", "directives", "theme"];
|
||||
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 () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue