import { describe, expect, it, vi, beforeEach } from 'vitest' import { mount } from '@vue/test-utils' import BetaChart from './BetaChart.vue' // Mock echarts to avoid canvas issues in jsdom vi.mock('echarts', () => ({ init: vi.fn(() => ({ setOption: vi.fn(), dispose: vi.fn(), resize: vi.fn(), })), })) describe('BetaChart.vue', () => { beforeEach(() => { vi.clearAllMocks() }) it('renders chart container without crashing', () => { const props = { dates: ['2024-01-01', '2024-01-02', '2024-01-03'], beta: [0.98, 0.99, 1.01], } const wrapper = mount(BetaChart, { props }) expect(wrapper.find('.chart-box').exists()).toBe(true) }) it('passes props correctly', () => { const props = { dates: ['2024-01-01', '2024-01-02'], beta: [0.98, 0.99], } const wrapper = mount(BetaChart, { props }) expect(wrapper.props()).toEqual(props) }) })