Olivier Massot пре 2 година
родитељ
комит
f491e7ce2d
1 измењених фајлова са 2 додато и 11 уклоњено
  1. 2 11
      tests/units/services/layout/menuBuilder/statsMenuBuilder.test.ts

+ 2 - 11
tests/units/services/layout/menuBuilder/statsMenuBuilder.test.ts

@@ -1,5 +1,4 @@
-
-import { describe, test, it, expect } from 'vitest'
+import {describe, expect, test} from 'vitest'
 import {RuntimeConfig} from "@nuxt/schema";
 import {AnyAbility} from "@casl/ability/dist/types";
 import {AccessProfile, organizationState} from "~/types/interfaces";
@@ -42,7 +41,7 @@ describe('build', () => {
         expect(result.label).toEqual('stats')
         expect(result.icon).toEqual({name: 'fas fa-chart-bar'})
         // @ts-ignore
-        expect(result.children.length).toEqual(5)
+        expect(result.children.length).toEqual(4)
     })
 
     test('has no items', () => {
@@ -78,12 +77,4 @@ describe('build', () => {
             {label: 'fede_stats', icon: {name: 'fas fa-chart-bar'}, to: 'https://mydomain.com/#/statistic/membersfedeonly', type: MENU_LINK_TYPE.V1, active: false}
         )
     })
-
-    test('has only rights for menu structure_stats', () => {
-        ability.can = vi.fn((action: string, subject: string) => action === 'display' && subject === 'structure_stats_page')
-
-        expect(menuBuilder.build()).toEqual(
-            {label: 'structure_stats', icon: {name: 'fas fa-chart-bar'}, to: 'https://mydomain.com/#/statistic/membersfedeassos', type: MENU_LINK_TYPE.V1, active: false}
-        )
-    })
 })