mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-04 14:57:42 +00:00
test: Restore dropped tenant-context coverage for GitHub skill sync
The prior commit shipped the getTenantId import in github.spec.ts without the tenant tests that use it (lost in an interrupted edit), which failed the eslint --max-warnings=0 CI job on an unused import. Restore both github.spec.ts tenant tests (tenant-scoped run stamps tenantId and executes inside the tenant ALS context; no-tenant run stays ambient) and the two config-schemas tenant tests (accepts tenantId, rejects __SYSTEM__).
This commit is contained in:
parent
7d688b9b7e
commit
4485914374
1 changed files with 45 additions and 0 deletions
|
|
@ -649,6 +649,51 @@ describe('configSchema skillSync', () => {
|
|||
expect(result.data?.skillSync?.github?.sources[0]?.paths).toEqual(['skills', '']);
|
||||
});
|
||||
|
||||
it('accepts an optional tenantId on a GitHub skill sync source', () => {
|
||||
const result = configSchema.safeParse({
|
||||
version: '1.3.11',
|
||||
skillSync: {
|
||||
github: {
|
||||
enabled: true,
|
||||
sources: [
|
||||
{
|
||||
id: 'librechat-skills',
|
||||
owner: 'LibreChat',
|
||||
repo: 'skills',
|
||||
paths: ['skills'],
|
||||
credentialKey: 'github-skills-prod',
|
||||
tenantId: 'tenant-a',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(result.success).toBe(true);
|
||||
expect(result.data?.skillSync?.github?.sources[0]?.tenantId).toBe('tenant-a');
|
||||
});
|
||||
|
||||
it('rejects the reserved system tenant id on a GitHub skill sync source', () => {
|
||||
const result = configSchema.safeParse({
|
||||
version: '1.3.11',
|
||||
skillSync: {
|
||||
github: {
|
||||
enabled: true,
|
||||
sources: [
|
||||
{
|
||||
id: 'librechat-skills',
|
||||
owner: 'LibreChat',
|
||||
repo: 'skills',
|
||||
paths: ['skills'],
|
||||
credentialKey: 'github-skills-prod',
|
||||
tenantId: '__SYSTEM__',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
|
||||
it('rejects enabled GitHub skill sync without sources', () => {
|
||||
const result = configSchema.safeParse({
|
||||
version: '1.3.11',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue