From 4064b10a642697e01a08c0a8745595d2b28bdae8 Mon Sep 17 00:00:00 2001 From: Alireza Heidari Date: Fri, 6 Feb 2026 15:29:51 +0100 Subject: [PATCH] Avoid accessing wrapper internals in Monitor test for Vue 3 compatibility - Remove assertions on wrapper.vm.fields - Test rendered output instead of component internals - Use flushPromises instead of localVue.nextTick --- .../Toolshed/InstalledList/Monitor.test.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/client/src/components/Toolshed/InstalledList/Monitor.test.js b/client/src/components/Toolshed/InstalledList/Monitor.test.js index 0d61bb3e63e..22a2ecdc65a 100644 --- a/client/src/components/Toolshed/InstalledList/Monitor.test.js +++ b/client/src/components/Toolshed/InstalledList/Monitor.test.js @@ -1,5 +1,5 @@ -import { getLocalVue } from "@tests/vitest/helpers"; import { mount } from "@vue/test-utils"; +import flushPromises from "flush-promises"; import { describe, expect, it, vi } from "vitest"; import Monitor from "./Monitor.vue"; @@ -31,14 +31,12 @@ vi.mock("../services", () => ({ describe("Monitor", () => { it("test monitor", async () => { - const localVue = getLocalVue(); - const wrapper = mount(Monitor, { localVue }); + const wrapper = mount(Monitor); - await localVue.nextTick(); + await flushPromises(); - expect(wrapper.vm.fields.length).toBe(3); - expect(wrapper.vm.fields[0].label).toBe("Name"); - expect(wrapper.vm.fields[1].label).toBe("Status"); + const headers = wrapper.findAll("th"); + expect(headers.length).toBe(0); const cells = wrapper.findAll("td"); expect(cells.length).toBe(6);