We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b659954 commit b0f2ee3Copy full SHA for b0f2ee3
test/integration/index.spec.js
@@ -423,8 +423,18 @@ describe('/tables', async () => {
423
constraint: "CHECK (description <> '')",
424
})
425
426
- // TODO: some way to check constraints?
427
- assert.equal(error, undefined)
+ const { data: constraints } = await axios.post(
+ `${URL}/query`,
428
+ { query: `
429
+ SELECT pg_get_constraintdef((
430
+ SELECT c.oid
431
+ FROM pg_constraint c
432
+ WHERE c.conrelid = '${newTable.name}'::regclass
433
+ ));
434
+ ` }
435
+ )
436
+ assert.equal(constraints.length, 1)
437
+ assert.equal(constraints[0].pg_get_constraintdef, "CHECK ((description <> ''::text))")
438
439
await axios.delete(`${URL}/columns/${newTable.id}.1`)
440
await axios.delete(`${URL}/tables/${newTable.id}`)
0 commit comments