feat: add portal database schema
This commit is contained in:
1 parent
763098b129
commit
7acaacb92e
17 files changed
+4410
-111
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import { afterAll, expect, test } from "vitest";
|
||||
import { startPostgres } from "./postgres";
|
||||
|
||||
const testDb = await startPostgres();
|
||||
|
||||
afterAll(() => testDb.stop());
|
||||
|
||||
test("rejects duplicate download idempotency keys for one editorial", async () => {
|
||||
const seed = await testDb.seedEditorialWithUsage();
|
||||
|
||||
await testDb.insertDownload({ ...seed, idempotencyKey: "same-request" });
|
||||
|
||||
await expect(
|
||||
testDb.insertDownload({ ...seed, idempotencyKey: "same-request" }),
|
||||
).rejects.toThrow();
|
||||
});
|
||||
Reference in new issue
Block a user