|
|
|
|
@ -2,6 +2,7 @@ import { describe, it, expect, beforeEach, afterEach } from 'bun:test';
|
|
|
|
|
import { makeMemDb } from '../../helpers/db';
|
|
|
|
|
import { GroupSyncService } from '../../../src/services/group-sync';
|
|
|
|
|
import { AllowedGroups } from '../../../src/services/allowed-groups';
|
|
|
|
|
import { setDb } from '../../../src/db/locator';
|
|
|
|
|
|
|
|
|
|
describe('GroupSyncService - gating en scheduler de miembros (enforce)', () => {
|
|
|
|
|
const envBackup = process.env;
|
|
|
|
|
@ -11,8 +12,7 @@ describe('GroupSyncService - gating en scheduler de miembros (enforce)', () => {
|
|
|
|
|
process.env = { ...envBackup, NODE_ENV: 'ci', GROUP_GATING_MODE: 'enforce' };
|
|
|
|
|
|
|
|
|
|
const memdb = makeMemDb();
|
|
|
|
|
(GroupSyncService as any).dbInstance = memdb;
|
|
|
|
|
(AllowedGroups as any).dbInstance = memdb;
|
|
|
|
|
setDb(memdb);
|
|
|
|
|
|
|
|
|
|
// Preparar caché de grupos activos (2 grupos: uno allowed y otro no)
|
|
|
|
|
GroupSyncService.activeGroupsCache.clear();
|
|
|
|
|
|