From 851f345ead2802457aafac9c916995bf3746bc07 Mon Sep 17 00:00:00 2001 From: FreePhoenix888 Date: Tue, 19 Dec 2023 09:50:39 +0000 Subject: [PATCH] Add `admin can insert Type` test --- tests/permissions.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/permissions.ts b/tests/permissions.ts index 3525d17f..e35d1981 100644 --- a/tests/permissions.ts +++ b/tests/permissions.ts @@ -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'),