Skip to content

Commit

Permalink
Merge pull request #287 from deep-foundation/tests/permissions/insert…
Browse files Browse the repository at this point in the history
…/admin_can_insert_type

Add `admin can insert Type` test
  • Loading branch information
FreePhoenix888 authored Dec 19, 2023
2 parents cfa5f3f + 851f345 commit 081d67f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/permissions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ describe('permissions', () => {
});
});
describe('insert', () => {
it('admin can insert Type', async () => {
const isAdminAbleToInsertTypeInstances = await deep.can(
await deep.id("@deep-foundation/core", "Type"),
await deep.id("@deep-foundation/core", "AllowInsertType"),
await deep.id("deep", "users", "admin")
)
assert.equal(isAdminAbleToInsertTypeInstances, true)
})
it(`root can insert`, async () => {
const { data: [{ id }], error } = await deep.insert({
type_id: await deep.id('@deep-foundation/core', 'Operation'),
Expand Down

0 comments on commit 081d67f

Please sign in to comment.