Skip to content

Commit

Permalink
fix: Mock ResizeObserver in Chart.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
bherbruck committed May 20, 2024
1 parent 1f9a3d7 commit bdbd08b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/Chart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ const customTheme = {
},
}

// Mock the ResizeObserver
const ResizeObserverMock = vi.fn(() => ({
observe: vi.fn(),
unobserve: vi.fn(),
disconnect: vi.fn(),
}))

// Stub the global ResizeObserver
vi.stubGlobal('ResizeObserver', ResizeObserverMock)

describe('Chart Component', () => {
echarts.use([
BarChart,
Expand Down

0 comments on commit bdbd08b

Please sign in to comment.