Skip to content

Commit

Permalink
bug-fix: fix assert
Browse files Browse the repository at this point in the history
  • Loading branch information
k1ch committed Nov 8, 2024
1 parent 1d755f4 commit 0d051b0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions database/test/db-admin-rolepermissions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ describe('Admin role permissions view', () => {
})

it('Should return an array of inserted rolepermissions records', async () => {
const [rolePermission] = await adminRolePermissions.insertRolePermissions(validRoleKey, [validPermissionKey])
assert.ok(!!rolePermission)
assert.equal(rolePermission.rolekey, validRoleKey)
assert.equal(rolePermission.permissionkey, validPermissionKey)
const rolePermissions = await adminRolePermissions.insertRolePermissions(validRoleKey, [validPermissionKey])
assert.equal(rolePermissions.length, 1)
assert.equal(rolePermissions[0].rolekey, validRoleKey)
assert.equal(rolePermissions[0].permissionkey, validPermissionKey)
})

it('Should ignore the duplicate permission keys', async () => {
Expand Down Expand Up @@ -72,7 +72,7 @@ describe('Admin role permissions view', () => {
})

afterEach(async () => {
await usherDb('rolepermissions').where({ rolekey: validRoleKey, permissionkey: validPermissionKey }).del()
await usherDb('rolepermissions').where({ rolekey: validRoleKey }).del()
})
})

Expand Down

0 comments on commit 0d051b0

Please sign in to comment.