|
|
@@ -42,7 +42,7 @@ describe('build', () => {
|
|
|
expect(result.label).toEqual('stats')
|
|
|
expect(result.icon).toEqual({name: 'fas fa-chart-bar'})
|
|
|
// @ts-ignore
|
|
|
- expect(result.children.length).toEqual(4)
|
|
|
+ expect(result.children.length).toEqual(5)
|
|
|
})
|
|
|
|
|
|
test('has no items', () => {
|
|
|
@@ -58,6 +58,19 @@ describe('build', () => {
|
|
|
)
|
|
|
})
|
|
|
|
|
|
+ test('has only rights for menu educations_quotas_by_education and accesses_quotas_courses_hebdos', () => {
|
|
|
+ ability.can = vi.fn((action: string, subject: string) => action === 'display' && subject === 'education_quotas_page')
|
|
|
+
|
|
|
+ const group = menuBuilder.build() as MenuGroup
|
|
|
+
|
|
|
+ expect(group.children).toEqual(
|
|
|
+ [
|
|
|
+ {label: 'educations_quotas_by_education', icon: {name: 'fas fa-user-circle'}, to: 'https://mydomain.com/#/educations_quotas_by_education_year/list/', type: MENU_LINK_TYPE.V1, active: false},
|
|
|
+ {label: 'accesses_quotas_courses_hebdos', icon: {name: 'fas fa-user-circle'}, to: 'https://mydomain.com/#/accesses_quotas_courses_hebdos/list/', type: MENU_LINK_TYPE.V1, active: false}
|
|
|
+ ]
|
|
|
+ )
|
|
|
+ })
|
|
|
+
|
|
|
test('has only rights for menu fede_stats', () => {
|
|
|
ability.can = vi.fn((action: string, subject: string) => action === 'display' && subject === 'fede_stats_page')
|
|
|
|