From 9feeb921f5a960b84dbd9140b5325946839dd1d0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 17 Apr 2026 19:00:57 +0100 Subject: [PATCH] test: trim config form search render cases --- ui/src/ui/config-form.browser.test.ts | 70 +++------------------------ 1 file changed, 6 insertions(+), 64 deletions(-) diff --git a/ui/src/ui/config-form.browser.test.ts b/ui/src/ui/config-form.browser.test.ts index 555454c2426..c5a9b87660b 100644 --- a/ui/src/ui/config-form.browser.test.ts +++ b/ui/src/ui/config-form.browser.test.ts @@ -32,12 +32,13 @@ const rootSchema = { }, }, }; +const rootAnalysis = analyzeConfigSchema(rootSchema); describe("config form renderer", () => { it("renders inputs and patches values", () => { const onPatch = vi.fn(); const container = document.createElement("div"); - const analysis = analyzeConfigSchema(rootSchema); + const analysis = rootAnalysis; render( renderConfigForm({ schema: analysis.schema, @@ -83,7 +84,7 @@ describe("config form renderer", () => { it("adds and removes array entries", () => { const onPatch = vi.fn(); const container = document.createElement("div"); - const analysis = analyzeConfigSchema(rootSchema); + const analysis = rootAnalysis; render( renderConfigForm({ schema: analysis.schema, @@ -109,7 +110,7 @@ describe("config form renderer", () => { it("renders union literals as select options", () => { const onPatch = vi.fn(); const container = document.createElement("div"); - const analysis = analyzeConfigSchema(rootSchema); + const analysis = rootAnalysis; render( renderConfigForm({ schema: analysis.schema, @@ -203,7 +204,7 @@ describe("config form renderer", () => { it("renders tags from uiHints metadata", () => { const onPatch = vi.fn(); const container = document.createElement("div"); - const analysis = analyzeConfigSchema(rootSchema); + const analysis = rootAnalysis; render( renderConfigForm({ schema: analysis.schema, @@ -227,7 +228,7 @@ describe("config form renderer", () => { it("filters by tag query", () => { const onPatch = vi.fn(); const container = document.createElement("div"); - const analysis = analyzeConfigSchema(rootSchema); + const analysis = rootAnalysis; render( renderConfigForm({ schema: analysis.schema, @@ -248,65 +249,6 @@ describe("config form renderer", () => { expect(container.textContent).not.toContain("Mode"); }); - it("does not treat plain text as tag filter", () => { - const onPatch = vi.fn(); - const container = document.createElement("div"); - const analysis = analyzeConfigSchema(rootSchema); - render( - renderConfigForm({ - schema: analysis.schema, - uiHints: { - "gateway.auth.token": { tags: ["security"] }, - }, - unsupportedPaths: analysis.unsupportedPaths, - value: {}, - searchQuery: "security", - onPatch, - }), - container, - ); - - expect(container.textContent).toContain('No settings match "security"'); - }); - - it("requires both text and tag when combined", () => { - const onPatch = vi.fn(); - const container = document.createElement("div"); - const analysis = analyzeConfigSchema(rootSchema); - render( - renderConfigForm({ - schema: analysis.schema, - uiHints: { - "gateway.auth.token": { tags: ["security"] }, - }, - unsupportedPaths: analysis.unsupportedPaths, - value: {}, - searchQuery: "token tag:security", - onPatch, - }), - container, - ); - - expect(container.textContent).toContain("Token"); - expect(container.textContent).not.toContain('No settings match "token tag:security"'); - - const noMatchContainer = document.createElement("div"); - render( - renderConfigForm({ - schema: analysis.schema, - uiHints: { - "gateway.auth.token": { tags: ["security"] }, - }, - unsupportedPaths: analysis.unsupportedPaths, - value: {}, - searchQuery: "mode tag:security", - onPatch, - }), - noMatchContainer, - ); - expect(noMatchContainer.textContent).toContain('No settings match "mode tag:security"'); - }); - it("supports SecretInput unions in additionalProperties maps", () => { const onPatch = vi.fn(); const container = document.createElement("div");