MAESTRO: wire header analyzer controls and captcha

This commit is contained in:
Mariusz Banach
2026-02-18 04:40:57 +01:00
parent cdda2b987f
commit ffce9053a8
9 changed files with 199 additions and 22 deletions

View File

@@ -18,8 +18,10 @@ const { submitSpy, cancelSpy, useAnalysisState } = vi.hoisted(() => {
progress: null,
result: null,
error: null,
captchaChallenge: null,
submit: submitSpy,
cancel: cancelSpy,
clearCaptchaChallenge: vi.fn(),
},
};
});
@@ -86,6 +88,7 @@ const resetUseAnalysisState = (): void => {
useAnalysisState.progress = null;
useAnalysisState.result = null;
useAnalysisState.error = null;
useAnalysisState.captchaChallenge = null;
};
afterEach(() => {
@@ -152,4 +155,15 @@ describe("Home page", () => {
const results = container.querySelector('[data-testid="analysis-results"]');
expect(results).not.toBeNull();
});
it("renders the captcha modal when rate limited", () => {
useAnalysisState.captchaChallenge = {
challengeToken: "challenge-123",
imageBase64: "image-data",
};
const { container } = render(<Home />);
const modal = container.querySelector('[data-testid="captcha-challenge"]');
expect(modal).not.toBeNull();
});
});