From 388650afc7544f99510bdef5544a173e12786e64 Mon Sep 17 00:00:00 2001 From: HenkDz Date: Wed, 1 Apr 2026 23:23:14 +0100 Subject: [PATCH] fix: update tests for SchemaConfigFields and comingSoon logic - registry.test: fallback now uses SchemaConfigFields, not ProcessConfigFields - metadata.test: isEnabledAdapterType checks comingSoon first so intentionally withheld built-in adapters (process/http) stay disabled --- ui/src/adapters/metadata.ts | 12 +++++++----- ui/src/adapters/registry.test.ts | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ui/src/adapters/metadata.ts b/ui/src/adapters/metadata.ts index 3a35030a..297a7237 100644 --- a/ui/src/adapters/metadata.ts +++ b/ui/src/adapters/metadata.ts @@ -26,9 +26,11 @@ export function listKnownAdapterTypes(): string[] { * Unknown types (external adapters) are always considered enabled. */ export function isEnabledAdapterType(type: string): boolean { - // Known external adapter — always valid - if (listUIAdapters().some((a) => a.type === type)) return true; - return !getAdapterDisplay(type).comingSoon; + // Check display registry first — built-in adapters like process/http are + // intentionally withheld even though they're registered as UI adapters. + if (getAdapterDisplay(type).comingSoon) return false; + // All other types (registered or external) are enabled. + return true; } /** @@ -37,8 +39,8 @@ export function isEnabledAdapterType(type: string): boolean { * any non-"coming soon" adapter from the display registry. */ export function isValidAdapterType(type: string): boolean { - if (listUIAdapters().some((a) => a.type === type)) return true; - return !getAdapterDisplay(type).comingSoon; + if (getAdapterDisplay(type).comingSoon) return false; + return true; } /** diff --git a/ui/src/adapters/registry.test.ts b/ui/src/adapters/registry.test.ts index b80dcc28..6d30f6b0 100644 --- a/ui/src/adapters/registry.test.ts +++ b/ui/src/adapters/registry.test.ts @@ -8,6 +8,7 @@ import { unregisterUIAdapter, } from "./registry"; import { processUIAdapter } from "./process"; +import { SchemaConfigFields } from "./schema-config-fields"; const externalUIAdapter: UIAdapterModule = { type: "external_test", @@ -44,7 +45,7 @@ describe("ui adapter registry", () => { // Unknown types return a lazy-loading wrapper (for external adapters), // not the process adapter directly. The type is preserved. expect(fallback.type).toBe("external_test"); - // But it uses the process parser under the hood. - expect(fallback.ConfigFields).toBe(processUIAdapter.ConfigFields); + // But it uses the schema-based config fields for external adapter forms. + expect(fallback.ConfigFields).toBe(SchemaConfigFields); }); });