31 lines
767 B
TypeScript
31 lines
767 B
TypeScript
import { describe, expect, test } from 'bun:test';
|
|||
|
|
import type { I18nKey } from '@/lib/i18n/store';
|
||
|
|
import { buildSettingsSearchResults } from './search';
|
||
|
|
|
||
|
|
const t = (key: I18nKey): string => key;
|
||
|
|
|
||
|
|
const runtimeCtx = {
|
||
|
|
isVSCode: false,
|
||
|
|
isWeb: true,
|
||
|
|
isDesktop: false,
|
||
|
|
isMobile: false,
|
||
|
|
isDesktopLocalOrigin: false,
|
||
|
|
isMac: false,
|
||
|
|
isWindows: false,
|
||
|
|
isLinux: false,
|
||
|
|
isWindowsArm64: false,
|
||
|
|
};
|
||
|
|
|
||
|
|
describe('settings search', () => {
|
||
|
|
test('finds the Claude Code third-party integration', () => {
|
||
|
|
const results = buildSettingsSearchResults({
|
||
|
|
query: 'claude',
|
||
|
|
runtimeCtx,
|
||
|
|
t,
|
||
|
|
getPageTitle: (page) => page,
|
||
|
|
});
|
||
|
|
|
||
|
|
expect(results.some((result) => result.id === 'integrations.third-party.opencode-claude')).toBe(true);
|
||
|
|
});
|
||
|
|
});
|