Files
OmniRoute/tests/unit/provider-icon-devin-desktop.test.ts
backryun acc066db3f [v3.8.50] feat(devin-desktop): replace public Windsurf provider (#8228)
* feat(devin-desktop): replace public Windsurf provider

* fix(migrations): renumber Devin Desktop migration to 151 (avoid 147 collision)

147_windsurf_to_devin_desktop.sql collided with the released
147_api_keys_model_access_mode.sql — getMigrationFiles throws
"Migration version collision detected" on every DB start. Base occupies
slots up to 150, so renumber the new migration to 151 and point the
windsurf→devin RENAMED_MIGRATION_COMPATIBILITY entries (and tests) at it.
147 is freed in KNOWN_GAPS since 147_api_keys now owns the slot.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>

---------

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
2026-08-12 08:40:18 -03:00

20 lines
951 B
TypeScript

import test from "node:test";
import assert from "node:assert/strict";
import { readFile } from "node:fs/promises";
const [providerIconSource, lobeProviderIconsSource] = await Promise.all([
readFile(new URL("../../src/shared/components/ProviderIcon.tsx", import.meta.url), "utf8"),
readFile(new URL("../../src/shared/components/lobeProviderIcons.ts", import.meta.url), "utf8"),
]);
test("devin-desktop skips the nonexistent local SVG on first render", () => {
const knownSvgs = providerIconSource.match(/const KNOWN_SVGS = new Set\(\[([\s\S]*?)\]\);/);
assert.ok(knownSvgs, "expected ProviderIcon KNOWN_SVGS declaration");
assert.doesNotMatch(knownSvgs[1], /["']devin-desktop["']/);
});
test("devin-desktop resolves to the existing Devin lobe icon", () => {
assert.match(lobeProviderIconsSource, /["']devin-desktop["']:\s*["']Devin["']/);
assert.doesNotMatch(lobeProviderIconsSource, /["']devin-desktop["']:\s*["']Windsurf["']/);
});