fix(ci): replace userEvent.selectOptions with fireEvent.change; bump setup-node to v6
userEvent.selectOptions hangs in jsdom when firing pointer + change event sequences — fireEvent.change fires the React-controlled onChange directly and is deterministic. Removes userEvent import (no longer used). Bump actions/setup-node from v4 to v6 to clear the Node.js 20 deprecation warning on GitHub Actions runners.
This commit is contained in:
2
.github/actions/setup/action.yml
vendored
2
.github/actions/setup/action.yml
vendored
@@ -6,7 +6,7 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: pnpm/action-setup@v6
|
- uses: pnpm/action-setup@v6
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: "24"
|
node-version: "24"
|
||||||
cache: pnpm
|
cache: pnpm
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||||
import { createMemoryHistory, createRouter, RouterProvider } from "@tanstack/react-router";
|
import { createMemoryHistory, createRouter, RouterProvider } from "@tanstack/react-router";
|
||||||
import { render, screen, waitFor, within } from "@testing-library/react";
|
import { fireEvent, render, screen, waitFor, within } from "@testing-library/react";
|
||||||
import userEvent from "@testing-library/user-event";
|
|
||||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||||
import { DemoProvider } from "@/context/DemoContext";
|
import { DemoProvider } from "@/context/DemoContext";
|
||||||
import { MetadataProvider } from "@/context/MetadataContext";
|
import { MetadataProvider } from "@/context/MetadataContext";
|
||||||
@@ -77,10 +76,10 @@ describe("Dashboard — unified server-aware view", () => {
|
|||||||
|
|
||||||
it("narrows to a single server when filtered", async () => {
|
it("narrows to a single server when filtered", async () => {
|
||||||
saveStore({ instances: [neo, iris], activeId: "neo" });
|
saveStore({ instances: [neo, iris], activeId: "neo" });
|
||||||
const user = userEvent.setup();
|
|
||||||
renderDashboard();
|
renderDashboard();
|
||||||
await screen.findByText("(Iris)");
|
await screen.findByText("(Iris)");
|
||||||
await user.selectOptions(await screen.findByLabelText("Filter by server"), "iris");
|
const select = await screen.findByLabelText("Filter by server");
|
||||||
|
fireEvent.change(select, { target: { value: "iris" } });
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(screen.queryByText("(Neo)")).not.toBeInTheDocument();
|
expect(screen.queryByText("(Neo)")).not.toBeInTheDocument();
|
||||||
expect(screen.getByText("(Iris)")).toBeInTheDocument();
|
expect(screen.getByText("(Iris)")).toBeInTheDocument();
|
||||||
|
|||||||
Reference in New Issue
Block a user