Add projects

This commit is contained in:
Alois 2026-08-24 00:10:41 +02:00
commit 8b607dd700
Signed by: alois
SSH key fingerprint: SHA256:GBzT2DXvAuGV9XIV5W3WrzVpjU54FThmxHXdbz95J24
1802 changed files with 503346 additions and 2 deletions

View file

@ -0,0 +1,40 @@
import { describe, expect, test } from 'vitest';
import { buildExcludedModels } from '../src/features/providers/useProviderWorkbench';
/**
* `excluded-models: ['*']` provider
* `disabled` flag flag
*
* textarea ExcludedModelsPicker
*
*/
describe('buildExcludedModels — the "*" disable-rule invariant', () => {
test('appends "*" when disabled', () => {
expect(buildExcludedModels('a\nb', true, 'gemini')).toEqual(['a', 'b', '*']);
});
test('omits "*" when not disabled', () => {
expect(buildExcludedModels('a\nb', false, 'gemini')).toEqual(['a', 'b']);
});
test('a hand-typed "*" never duplicates the disable rule', () => {
expect(buildExcludedModels('a\n*\nb', true, 'gemini')).toEqual(['a', 'b', '*']);
});
test('a hand-typed "*" never switches the provider to disabled', () => {
expect(buildExcludedModels('a\n*\nb', false, 'gemini')).toEqual(['a', 'b']);
});
test('disabled with no rules yields exactly the disable rule', () => {
expect(buildExcludedModels('', true, 'gemini')).toEqual(['*']);
});
test('no rules and not disabled yields undefined, not an empty array', () => {
expect(buildExcludedModels('', false, 'gemini')).toBeUndefined();
});
test('openaiCompatibility never receives the disable rule', () => {
expect(buildExcludedModels('a', true, 'openaiCompatibility')).toEqual(['a']);
expect(buildExcludedModels('', true, 'openaiCompatibility')).toBeUndefined();
});
});