mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 12:30:58 +00:00
14 lines
530 B
TypeScript
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([]);
|
|
});
|
|
});
|