mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-27 05:57:27 +00:00
Stub the history chart in the guest physical disk test
The expanded disk detail now shows its history charts in view, so this test mounted HistoryChart, which measures itself with ResizeObserver. jsdom has none, and the unhandled error failed the frontend job even though every test passed. Chart rendering stays covered by the HistoryChart and DiskDetail suites.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { cleanup, fireEvent, render, screen, waitFor, within } from '@solidjs/testing-library';
|
||||
import { createSignal } from 'solid-js';
|
||||
import { createSignal, type JSX } from 'solid-js';
|
||||
import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
|
||||
import { AlertsAPI } from '@/api/alerts';
|
||||
import { useAlertsActivation } from '@/stores/alertsActivation';
|
||||
@@ -17,6 +17,14 @@ const queryState = vi.hoisted(() => ({
|
||||
enabled: false,
|
||||
}));
|
||||
|
||||
// The expanded disk detail now shows its history charts in view; the chart
|
||||
// measures itself with ResizeObserver, which jsdom lacks. Its rendering is
|
||||
// covered by the HistoryChart and DiskDetail suites.
|
||||
vi.mock('@/components/shared/HistoryChart', () => ({
|
||||
HistoryChartHoverGroup: (props: { children: JSX.Element }) => <div>{props.children}</div>,
|
||||
HistoryChart: (props: { label: string }) => <div data-testid="history-chart">{props.label}</div>,
|
||||
}));
|
||||
|
||||
vi.mock('@/hooks/useUnifiedResources', () => ({
|
||||
useUnifiedResources: (options: { query: string; enabled: () => boolean }) => {
|
||||
queryState.query = options.query;
|
||||
|
||||
Reference in New Issue
Block a user