|
@@ -1,4 +1,4 @@
|
|
|
-import { describe, test, expect } from 'vitest'
|
|
|
|
|
|
|
+import { describe, test, expect, vi, beforeEach } from 'vitest'
|
|
|
import type { MongoAbility } from '@casl/ability/dist/types/Ability'
|
|
import type { MongoAbility } from '@casl/ability/dist/types/Ability'
|
|
|
import type {
|
|
import type {
|
|
|
AbilitiesType,
|
|
AbilitiesType,
|
|
@@ -110,8 +110,8 @@ describe('buildAbilitiesFromConfig', () => {
|
|
|
abilityBuilder.hasConfigAbility = vi.fn(() => true)
|
|
abilityBuilder.hasConfigAbility = vi.fn(() => true)
|
|
|
|
|
|
|
|
expect(abilityBuilder.buildAbilitiesFromConfig()).toEqual([
|
|
expect(abilityBuilder.buildAbilitiesFromConfig()).toEqual([
|
|
|
- { action: 'read', subject: 'subject1' },
|
|
|
|
|
- { action: 'read', subject: 'subject2' },
|
|
|
|
|
|
|
+ { action: 'read', subject: 'subject1', inverted: false },
|
|
|
|
|
+ { action: 'read', subject: 'subject2', inverted: false },
|
|
|
])
|
|
])
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|