From dd224c85603db2eba64b1b2d4e06a6e0b614eed0 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 22:20:47 +0100 Subject: [PATCH] test: tighten xai onboard assertions --- extensions/xai/onboard.test.ts | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/extensions/xai/onboard.test.ts b/extensions/xai/onboard.test.ts index a1e25cf49c1..df5d1e3205c 100644 --- a/extensions/xai/onboard.test.ts +++ b/extensions/xai/onboard.test.ts @@ -13,10 +13,8 @@ import { applyXaiConfig, applyXaiProviderConfig, XAI_DEFAULT_MODEL_REF } from ". describe("xai onboard", () => { it("adds xAI provider with correct settings", () => { const cfg = applyXaiConfig({}); - expect(cfg.models?.providers?.xai).toMatchObject({ - baseUrl: "https://api.x.ai/v1", - api: "openai-responses", - }); + expect(cfg.models?.providers?.xai?.baseUrl).toBe("https://api.x.ai/v1"); + expect(cfg.models?.providers?.xai?.api).toBe("openai-responses"); expect(resolveAgentModelPrimaryValue(cfg.agents?.defaults?.model)).toBe(XAI_DEFAULT_MODEL_REF); }); @@ -33,16 +31,13 @@ describe("xai onboard", () => { expect(cfg.models?.providers?.xai?.baseUrl).toBe("https://api.x.ai/v1"); expect(cfg.models?.providers?.xai?.api).toBe("openai-responses"); expect(cfg.models?.providers?.xai?.apiKey).toBe("old-key"); - expect(cfg.models?.providers?.xai?.models.map((m) => m.id)).toEqual( - expect.arrayContaining([ - "custom-model", - "grok-4.3", - "grok-4", - "grok-4-1-fast", - "grok-4.20-beta-latest-reasoning", - "grok-code-fast-1", - ]), - ); + const modelIds = cfg.models?.providers?.xai?.models.map((m) => m.id) ?? []; + expect(modelIds).toContain("custom-model"); + expect(modelIds).toContain("grok-4.3"); + expect(modelIds).toContain("grok-4"); + expect(modelIds).toContain("grok-4-1-fast"); + expect(modelIds).toContain("grok-4.20-beta-latest-reasoning"); + expect(modelIds).toContain("grok-code-fast-1"); }); it("adds expected alias for the default model", () => {