feat(FEAT-MO-005): 展示市场结构与成交额趋势

This commit is contained in:
2026-08-25 02:33:21 +08:00
parent b95b9e5c92
commit 64a9f2e866
10 changed files with 610 additions and 10 deletions
@@ -50,4 +50,28 @@ describe('市场概览状态', () => {
expect(second.analysisHorizon.value).toBe('短线');
expect(second.analysisEngine.value).toBe('混合');
});
it('切换行业结构分类时重新请求对应数据', async () => {
const api = {
getSectorRankings: vi.fn().mockResolvedValue(response),
getCapitalFlow: vi.fn().mockResolvedValue(response),
};
const state = useMarketOverview(api as never);
await state.refreshSectorRankings('concept');
await state.refreshCapitalFlow('board');
expect(api.getSectorRankings).toHaveBeenCalledWith({
category: 'concept',
sort: 'rise',
limit: 10,
});
expect(api.getCapitalFlow).toHaveBeenCalledWith({
category: 'board',
sort: 'inflow',
limit: 10,
});
expect(state.sectorCategory.value).toBe('concept');
expect(state.capitalFlowCategory.value).toBe('board');
});
});