Browse Source

BTTF-51 test

Vincent GUFFON 4 years ago
parent
commit
432d5dca46

+ 3 - 0
.gitignore

@@ -68,6 +68,9 @@ typings/
 # nuxt.js build output
 .nuxt
 
+# nuxt.js build output
+.output
+
 # Nuxt generate
 dist
 

+ 2 - 1
tests/unit/services/profile/accessProfile.spec.ts

@@ -12,7 +12,8 @@ beforeEach(() => {
   store = createStore()
   store.registerModule('profile', {})
   store.registerModule(['profile', 'access'], accessModule)
-  accessProfile = $accessProfile(store, ability)
+  accessProfile = $accessProfile(store)
+  accessProfile.setAbility(ability)
 })
 
 describe('hasRole()', () => {

+ 2 - 1
tests/unit/services/rights/abilitiesUtils.spec.ts

@@ -23,7 +23,7 @@ describe('initFactory', () => {
     abilitiesUtils.initFactory()
   })
   it('should init the factory service and give access to AccessProfile service', () => {
-    expect(abilitiesUtils.getFactory().access).toStrictEqual($accessProfile(store, ability))
+    expect(abilitiesUtils.getFactory().access).toStrictEqual($accessProfile(store))
   })
 
   it('should init the factory service and give access to OrganizationProfile service', () => {
@@ -165,6 +165,7 @@ describe('canHaveTheAbility()', () => {
 
   beforeEach(() => {
     abilitiesUtils.initFactory()
+    abilitiesUtils.initAbilities()
   })
 
   it('should return false when we dont have the ability', () => {