mirror of
https://github.com/mgeeky/decode-spam-headers.git
synced 2026-02-22 13:33:30 +01:00
MAESTRO: default DNS toggle off
This commit is contained in:
@@ -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] Test selector renders all 106+ tests with checkboxes
|
||||||
- [x] Select All / Deselect All buttons work correctly
|
- [x] Select All / Deselect All buttons work correctly
|
||||||
- [x] Search/filter narrows visible tests by name
|
- [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
|
- [ ] Decode-all toggle is functional
|
||||||
- [ ] All controls are keyboard accessible (Tab, Enter, Space)
|
- [ ] All controls are keyboard accessible (Tab, Enter, Space)
|
||||||
- [ ] Linting passes (`ruff check backend/`, `npx eslint src/`)
|
- [ ] Linting passes (`ruff check backend/`, `npx eslint src/`)
|
||||||
|
|||||||
@@ -96,11 +96,8 @@ afterEach(() => {
|
|||||||
describe("AnalysisControls", () => {
|
describe("AnalysisControls", () => {
|
||||||
it("renders toggles with default off state", async () => {
|
it("renders toggles with default off state", async () => {
|
||||||
setupFetchMock(sampleTests);
|
setupFetchMock(sampleTests);
|
||||||
const config: AnalysisConfig = { testIds: [], resolve: false, decodeAll: false };
|
|
||||||
|
|
||||||
const { container } = render(
|
const { container } = render(<AnalysisControls onChange={() => undefined} />);
|
||||||
<AnalysisControls config={config} onChange={() => undefined} />,
|
|
||||||
);
|
|
||||||
|
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
await flushPromises();
|
await flushPromises();
|
||||||
|
|||||||
@@ -13,10 +13,16 @@ import type { AnalysisConfig } from "../types/analysis";
|
|||||||
import TestSelector from "./TestSelector";
|
import TestSelector from "./TestSelector";
|
||||||
|
|
||||||
type AnalysisControlsProps = {
|
type AnalysisControlsProps = {
|
||||||
config: AnalysisConfig;
|
config?: AnalysisConfig;
|
||||||
onChange: (next: AnalysisConfig) => void;
|
onChange: (next: AnalysisConfig) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const defaultConfig: AnalysisConfig = {
|
||||||
|
testIds: [],
|
||||||
|
resolve: false,
|
||||||
|
decodeAll: false,
|
||||||
|
};
|
||||||
|
|
||||||
const handleToggleKeyDown = (
|
const handleToggleKeyDown = (
|
||||||
event: KeyboardEvent<HTMLButtonElement>,
|
event: KeyboardEvent<HTMLButtonElement>,
|
||||||
onToggle: () => void,
|
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[]) => {
|
const updateTests = (nextTestIds: number[]) => {
|
||||||
onChange({ ...config, testIds: nextTestIds });
|
onChange({ ...config, testIds: nextTestIds });
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user