unify Semi UI query metric rails

This commit is contained in:
lingniu
2026-07-18 09:02:54 +08:00
parent fb7cb4c6d6
commit 1688ba1b50
7 changed files with 345 additions and 342 deletions

View File

@@ -17,6 +17,7 @@ const profileSyncPanelSource = readFileSync(resolve(process.cwd(), 'src/v2/pages
const sourceEvidenceSource = readFileSync(resolve(process.cwd(), 'src/v2/shared/VehicleSourceEvidencePanel.tsx'), 'utf8');
const mobileFilterToggleSource = readFileSync(resolve(process.cwd(), 'src/v2/shared/MobileFilterToggle.tsx'), 'utf8');
const workspaceFilterPanelSource = readFileSync(resolve(process.cwd(), 'src/v2/shared/WorkspaceFilterPanel.tsx'), 'utf8');
const workspaceMetricRailSource = readFileSync(resolve(process.cwd(), 'src/v2/shared/WorkspaceMetricRail.tsx'), 'utf8');
const segmentedTabsSource = readFileSync(resolve(process.cwd(), 'src/v2/shared/SegmentedTabs.tsx'), 'utf8');
const metricActionSource = readFileSync(resolve(process.cwd(), 'src/v2/shared/MetricActionButton.tsx'), 'utf8');
const tablePaginationSource = readFileSync(resolve(process.cwd(), 'src/v2/shared/TablePagination.tsx'), 'utf8');
@@ -127,10 +128,13 @@ describe('V2 production entry', () => {
expect(corePageSources.HistoryPage).toContain('v2-history-column-sidesheet');
expect(corePageSources.HistoryPage).toContain('<Card key={row.id} className={`v2-history-mobile-card');
expect(corePageSources.HistoryPage).toContain('v2-history-trend');
for (const surface of ['v2-export-jobs', 'v2-history-evidence', 'v2-history-context-card']) {
for (const surface of ['v2-export-jobs', 'v2-history-evidence']) {
expect(corePageSources.HistoryPage).toContain(`<Card className="${surface}"`);
}
expect(corePageSources.HistoryPage).toContain('<div className="v2-history-summary" aria-label="当前查询摘要">');
expect(corePageSources.HistoryPage).toContain('<WorkspaceMetricRail');
expect(corePageSources.HistoryPage).toContain('className="v2-history-summary-rail"');
expect(corePageSources.HistoryPage).not.toContain('v2-history-context-card');
expect(corePageSources.HistoryPage).not.toContain('v2-history-metric-scroll');
expect(corePageSources.HistoryPage).toContain('<WorkspaceFilterPanel');
expect(corePageSources.HistoryPage).toContain('className="v2-history-filter-card"');
expect(corePageSources.HistoryPage).toContain('<Card className={`v2-history-table-card');
@@ -326,9 +330,10 @@ describe('V2 production entry', () => {
expect(corePageSources.TrackPage).not.toContain('<button');
expect(corePageSources.StatisticsPage).toContain('<Input');
expect(corePageSources.StatisticsPage).toContain('className="v2-mileage-query-panel"');
expect(corePageSources.StatisticsPage).toContain('<Card className="v2-mileage-summary"');
expect(corePageSources.StatisticsPage).toContain('<CardGroup className="v2-mileage-summary-secondary"');
expect(corePageSources.StatisticsPage).toContain('<Card className="v2-mileage-summary-card');
expect(corePageSources.StatisticsPage).toContain('<WorkspaceMetricRail');
expect(corePageSources.StatisticsPage).toContain('className="v2-mileage-summary"');
expect(corePageSources.StatisticsPage).toContain('secondaryClassName="v2-mileage-summary-secondary"');
expect(corePageSources.StatisticsPage).toContain('cardClassName="v2-mileage-summary-card"');
expect(corePageSources.StatisticsPage).toContain('<Card key={source.protocol} className={`v2-mileage-source-card');
expect(corePageSources.StatisticsPage).not.toContain('<section className="v2-mileage-summary"');
expect(corePageSources.StatisticsPage).not.toContain('<article key={source.protocol}');
@@ -346,6 +351,9 @@ describe('V2 production entry', () => {
expect(corePageSources.StatisticsPage).toContain('<PanelEmpty className="v2-mileage-empty"');
expect(corePageSources.StatisticsPage).not.toContain('<table className="v2-mileage-table"');
expect(corePageSources.StatisticsPage).not.toContain('<input');
expect(workspaceMetricRailSource).toContain("import { Card, CardGroup } from '@douyinfe/semi-ui'");
expect(workspaceMetricRailSource).toContain('<Card className={className}');
expect(workspaceMetricRailSource).toContain('<CardGroup className={secondaryClassName}');
expect(corePageSources.MonitorPage).toContain('<Input');
expect(corePageSources.MonitorPage).toContain('<Select');
expect(corePageSources.MonitorPage).toContain('<Modal');
@@ -431,7 +439,7 @@ describe('V2 production entry', () => {
expect(corePageSources[name]).toContain("from '../shared/MetricActionButton'");
expect(corePageSources[name]).toContain('<MetricActionButton');
}
expect(corePageSources.HistoryPage).toContain('<Tag className="v2-history-metric-tag"');
expect(corePageSources.HistoryPage).toContain('className="v2-history-result-meta"');
expect(corePageSources.AlertsPage).toContain('<Tag className={`v2-alert-severity');
expect(corePageSources.AlertsPage).toContain('<Tag className={`v2-alert-status');
expect(corePageSources.AlertsPage).toContain('className="v2-alert-inspector-heading"');