2026-06-09 12:54:55 +08:00
|
|
|
/**
|
|
|
|
|
* US-006: Frontend component rendering tests.
|
|
|
|
|
* Tests that key components render without errors.
|
|
|
|
|
*/
|
|
|
|
|
import { describe, it, expect } from 'vitest';
|
|
|
|
|
|
|
|
|
|
describe('Component exports', () => {
|
|
|
|
|
it('TopNav 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/TopNav');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.TopNav).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('SideNav 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/SideNav');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.SideNav).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('StatCard 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/StatCard');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.StatCard).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('ErrorBanner 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/ErrorBanner');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.ErrorBanner).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('DiseaseFilter 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/DiseaseFilter');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.DiseaseFilter).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('ChatBot 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/ChatBot');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.ChatBot).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('TimelinePlayer 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/TimelinePlayer');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.TimelinePlayer).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('StatisticalCharts 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/StatisticalCharts');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.StatisticalCharts).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('RiskMap 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/RiskMap');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.RiskMap).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('AlertMap 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/AlertMap');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.AlertMap).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('CaseLocationMap 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/CaseLocationMap');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.CaseLocationMap).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('CaseMap 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/CaseMap');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.CaseMap).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('DistributionChart 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/DistributionChart');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.DistributionChart).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('GridStatsOverlay 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/GridStatsOverlay');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.GridStatsOverlay).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('LodGridLayer 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/LodGridLayer');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.LodGridLayer).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('AdminBreadcrumb 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/AdminBreadcrumb');
|
feat: add analysis pages and raster risk map
Ship a new app version with broader analytics, restructured
dashboards, and a server-rendered risk map.
Frontend:
- Add Overview, Demographic, Disease, and Environmental Health
analysis pages
- Add AnomalyMarkers, CalendarHeatmap, and MetricHeatmapTable
components
- Rebuild Alerts map onto server-rendered raster risk tiles;
expand Monitoring, Trend, and District Comparison views
- Extend API client, stores, and TypeScript types
Backend:
- Add environment router (pollutants, lag correlations)
- Add risk_raster util serving XYZ 100m risk tiles
- Expand cases endpoints (demographics, seasonality, diagnoses)
and insights; harden auth and file-based loaders
Data & tooling:
- Add processed outpatient/inpatient/combined case parquet (LFS)
- Add nested CLAUDE.md guides, pyrightconfig, and test updates
2026-06-21 17:35:03 +08:00
|
|
|
expect((mod as any).default || mod.AdminBreadcrumb).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('CalendarHeatmap 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/CalendarHeatmap');
|
|
|
|
|
expect((mod as any).default || mod.CalendarHeatmap).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('MetricHeatmapTable 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/MetricHeatmapTable');
|
|
|
|
|
expect((mod as any).default || mod.MetricHeatmapTable).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('AnomalyMarkers 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/components/AnomalyMarkers');
|
|
|
|
|
expect((mod as any).default || mod.AnomalyMarkers).toBeDefined();
|
2026-06-09 12:54:55 +08:00
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('Page exports', () => {
|
|
|
|
|
it('MonitoringDashboard 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/pages/MonitoringDashboard');
|
|
|
|
|
expect(mod.MonitoringDashboard).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('AlertsDashboard 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/pages/AlertsDashboard');
|
|
|
|
|
expect(mod.AlertsDashboard).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('TrendAnalysis 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/pages/TrendAnalysis');
|
|
|
|
|
expect(mod.TrendAnalysis).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('DistrictComparison 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/pages/DistrictComparison');
|
|
|
|
|
expect(mod.DistrictComparison).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('Insights 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/pages/Insights');
|
|
|
|
|
expect(mod.Insights).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('Login 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/pages/Login');
|
|
|
|
|
expect(mod.Login).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('ReportsCenter 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/pages/ReportsCenter');
|
|
|
|
|
expect(mod.ReportsCenter).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('Store exports', () => {
|
|
|
|
|
it('所有 store 可以被导入', async () => {
|
|
|
|
|
const mod = await import('@/stores');
|
|
|
|
|
expect(mod.useRiskStore).toBeDefined();
|
|
|
|
|
expect(mod.useTimelineStore).toBeDefined();
|
|
|
|
|
expect(mod.useMonitoringStore).toBeDefined();
|
|
|
|
|
expect(mod.usePredictionStore).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe('Type exports', () => {
|
|
|
|
|
it('所有类型可以被导入', async () => {
|
|
|
|
|
const types = await import('@/types');
|
|
|
|
|
expect(types).toBeDefined();
|
|
|
|
|
});
|
|
|
|
|
});
|