Files
edr-platform/apps/edr-freight-api/src/seed/freight-permissions.registry.spec.ts
2026-07-29 06:28:42 +00:00

14 lines
530 B
TypeScript

import { EDR_FREIGHT_PERMISSIONS } from './edr-freight.seed';
describe('EDR_FREIGHT_PERMISSIONS', () => {
// The seeder inserts the whole catalog in one ON CONFLICT (key) DO UPDATE
// statement — a duplicated key there is a Postgres 21000 at boot, not a
// silent no-op.
it('has no duplicate keys', () => {
const keys = EDR_FREIGHT_PERMISSIONS.map((permission) => permission.key);
const duplicates = [...new Set(keys.filter((key, i) => keys.indexOf(key) !== i))];
expect(duplicates).toEqual([]);
});
});