diff --git a/app/routes/__tests__/analyze.ticker.ui.test.tsx b/app/routes/__tests__/analyze.ticker.ui.test.tsx index 07c07b3..064b2ed 100644 --- a/app/routes/__tests__/analyze.ticker.ui.test.tsx +++ b/app/routes/__tests__/analyze.ticker.ui.test.tsx @@ -1,5 +1,16 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; import { render, screen, fireEvent, waitFor } from "@testing-library/react"; + +// Mock lightweight-charts to avoid canvas in test environment +vi.mock("lightweight-charts", () => ({ + createChart: () => ({ + timeScale: () => ({ applyOptions: () => {}, fitContent: () => {} }), + addSeries: () => ({ setData: () => {} }), + remove: () => {}, + }), + CandlestickSeries: {}, +})); + import StockDetail from "../analyze.ticker"; import { MemoryRouter } from "react-router";