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:
Danny Avila 2026-05-30 12:30:51 -04:00
parent 7d688b9b7e
commit 4485914374
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956

View file

@ -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',