chore(per-instance-hook-scoping): archive verified+synced change
Move to openspec/changes/archive/2026-07-09-per-instance-hook-scoping/ (R100 renames preserved). 9 artifacts. Canonical openspec/specs/ service-instance-scoping/ remains. Resolves multi-instance wrong-data bug (hooks now scope by instance.id; instance switcher re-scopes). Carry-overs: fetchBackupDashboard untouched (design decision 5); subquery scoping for runs/alerts (schema asymmetry).
This commit is contained in:
@@ -3,7 +3,10 @@ import { renderHook } from "@testing-library/react";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { createElement, type ReactNode } from "react";
|
||||
import { useBackupJobs, useBackupRuns, useBackupAlerts } from "../useBackups";
|
||||
import { useAlertmanagerAlerts, usePrometheusStatus } from "../useObservability";
|
||||
import {
|
||||
useAlertmanagerAlerts,
|
||||
usePrometheusStatus,
|
||||
} from "../useObservability";
|
||||
|
||||
vi.mock("../../api/client", () => ({
|
||||
fetchAlertmanagerAlerts: vi.fn(),
|
||||
@@ -68,10 +71,9 @@ describe("per-instance hook queryKey isolation", () => {
|
||||
|
||||
it("useAlertmanagerAlerts includes serviceId in queryKey", () => {
|
||||
const wrapper = createWrapper();
|
||||
const { result: a } = renderHook(
|
||||
() => useAlertmanagerAlerts("svc-a"),
|
||||
{ wrapper },
|
||||
);
|
||||
const { result: a } = renderHook(() => useAlertmanagerAlerts("svc-a"), {
|
||||
wrapper,
|
||||
});
|
||||
expect(a).toBeDefined();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user