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([]); }); });