Files
DashBoard/frontend/tests/portal-shell-route-query.test.js
egg f14591c7dc feat(mid-section-defect): full-line bidirectional defect trace center with dual query mode
Transform /mid-section-defect from TMTT-only backward analysis into a full-line
bidirectional defect traceability center supporting all detection stations.

Key changes:
- Parameterized station detection: any workcenter group as detection station
- Bidirectional tracing: backward (upstream attribution) + forward (downstream reject rates)
- Dual query mode: date range OR LOT/工單/WAFER container-based seed resolution
- Multi-select filters for upstream station, equipment model (RESOURCEFAMILYNAME), and loss reasons
- Progressive 3-stage trace pipeline (seed-resolve → lineage → events) with streaming UI
- Equipment model lookup via resource cache instead of SPECNAME
- Session caching, auto-refresh, searchable MultiSelect with fuzzy matching
- Remove legacy tmtt-defect module (fully superseded)
- Archive openspec change artifacts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 16:16:33 +08:00

37 lines
1.1 KiB
JavaScript

import test from 'node:test';
import assert from 'node:assert/strict';
import { buildLaunchHref } from '../src/portal-shell/routeQuery.js';
test('buildLaunchHref keeps base target route without query payload', () => {
assert.equal(buildLaunchHref('/job-query'), '/job-query');
});
test('buildLaunchHref appends scalar query values', () => {
assert.equal(
buildLaunchHref('/job-query', { q: 'ABCD', page: '2' }),
'/job-query?q=ABCD&page=2',
);
});
test('buildLaunchHref supports repeated query keys from array values', () => {
assert.equal(
buildLaunchHref('/excel-query', { lotid: ['L1', 'L2'], mode: 'upload' }),
'/excel-query?lotid=L1&lotid=L2&mode=upload',
);
});
test('buildLaunchHref replaces existing query keys with latest runtime values', () => {
assert.equal(
buildLaunchHref('/query-tool?mode=legacy&page=1', { mode: 'runtime', page: '3' }),
'/query-tool?mode=runtime&page=3',
);
});
test('buildLaunchHref ignores empty and null-like query values', () => {
assert.equal(
buildLaunchHref('/mid-section-defect', { start_date: '', end_date: null, shift: undefined }),
'/mid-section-defect',
);
});