From 196689f0416181a3596d96b14687b1a01437e8da Mon Sep 17 00:00:00 2001 From: Mariusz Banach Date: Wed, 18 Feb 2026 01:25:02 +0100 Subject: [PATCH] MAESTRO: default DNS toggle off --- ...t-web-header-analyzer-Phase-04-Test-Selection.md | 2 +- frontend/src/__tests__/AnalysisControls.test.tsx | 5 +---- frontend/src/components/AnalysisControls.tsx | 13 +++++++++++-- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Auto Run Docs/SpecKit-web-header-analyzer-Phase-04-Test-Selection.md b/Auto Run Docs/SpecKit-web-header-analyzer-Phase-04-Test-Selection.md index 723e44e..c1321bc 100644 --- a/Auto Run Docs/SpecKit-web-header-analyzer-Phase-04-Test-Selection.md +++ b/Auto Run Docs/SpecKit-web-header-analyzer-Phase-04-Test-Selection.md @@ -34,7 +34,7 @@ This phase implements the test selection panel and analysis configuration contro - [x] Test selector renders all 106+ tests with checkboxes - [x] Select All / Deselect All buttons work correctly - [x] Search/filter narrows visible tests by name -- [ ] DNS resolution toggle defaults to off +- [x] DNS resolution toggle defaults to off - [ ] Decode-all toggle is functional - [ ] All controls are keyboard accessible (Tab, Enter, Space) - [ ] Linting passes (`ruff check backend/`, `npx eslint src/`) diff --git a/frontend/src/__tests__/AnalysisControls.test.tsx b/frontend/src/__tests__/AnalysisControls.test.tsx index 8f81406..54f364d 100644 --- a/frontend/src/__tests__/AnalysisControls.test.tsx +++ b/frontend/src/__tests__/AnalysisControls.test.tsx @@ -96,11 +96,8 @@ afterEach(() => { describe("AnalysisControls", () => { it("renders toggles with default off state", async () => { setupFetchMock(sampleTests); - const config: AnalysisConfig = { testIds: [], resolve: false, decodeAll: false }; - const { container } = render( - undefined} />, - ); + const { container } = render( undefined} />); await act(async () => { await flushPromises(); diff --git a/frontend/src/components/AnalysisControls.tsx b/frontend/src/components/AnalysisControls.tsx index e1563be..ed4c2ab 100644 --- a/frontend/src/components/AnalysisControls.tsx +++ b/frontend/src/components/AnalysisControls.tsx @@ -13,10 +13,16 @@ import type { AnalysisConfig } from "../types/analysis"; import TestSelector from "./TestSelector"; type AnalysisControlsProps = { - config: AnalysisConfig; + config?: AnalysisConfig; onChange: (next: AnalysisConfig) => void; }; +const defaultConfig: AnalysisConfig = { + testIds: [], + resolve: false, + decodeAll: false, +}; + const handleToggleKeyDown = ( event: KeyboardEvent, onToggle: () => void, @@ -27,7 +33,10 @@ const handleToggleKeyDown = ( } }; -export default function AnalysisControls({ config, onChange }: AnalysisControlsProps) { +export default function AnalysisControls({ + config = defaultConfig, + onChange, +}: AnalysisControlsProps) { const updateTests = (nextTestIds: number[]) => { onChange({ ...config, testIds: nextTestIds }); };