|
|
@@ -52,7 +52,7 @@ describe('build', () => {
|
|
|
expect(result.label).toEqual('configuration')
|
|
|
expect(result.icon).toEqual({ name: 'fas fa-cogs' })
|
|
|
// @ts-ignore
|
|
|
- expect(result.children.length).toEqual(13)
|
|
|
+ expect(result.children.length).toEqual(16)
|
|
|
})
|
|
|
|
|
|
test('has no items', () => {
|
|
|
@@ -221,4 +221,68 @@ describe('build', () => {
|
|
|
active: false,
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
+ test('has only rights for menu parcours', () => {
|
|
|
+ ability.can = vi.fn(
|
|
|
+ (action: string, subject: string) =>
|
|
|
+ action === 'display' && subject === 'parcours_page',
|
|
|
+ )
|
|
|
+
|
|
|
+ expect(menuBuilder.build()).toEqual({
|
|
|
+ label: 'parcours',
|
|
|
+ icon: undefined,
|
|
|
+ to: 'https://mydomain.com/#/family_quotient_models/list/',
|
|
|
+ target: '_self',
|
|
|
+ type: MENU_LINK_TYPE.V1,
|
|
|
+ active: false,
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ test('has only rights for menu family_quotient_models', () => {
|
|
|
+ ability.can = vi.fn(
|
|
|
+ (action: string, subject: string) =>
|
|
|
+ action === 'display' && subject === 'family_quotient_models_page',
|
|
|
+ )
|
|
|
+
|
|
|
+ expect(menuBuilder.build()).toEqual({
|
|
|
+ label: 'family_quotient_models',
|
|
|
+ icon: undefined,
|
|
|
+ to: 'https://mydomain.com/#/family_quotient_models/list/',
|
|
|
+ target: '_self',
|
|
|
+ type: MENU_LINK_TYPE.V1,
|
|
|
+ active: false,
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ test('has only rights for menu billing_schedules', () => {
|
|
|
+ ability.can = vi.fn(
|
|
|
+ (action: string, subject: string) =>
|
|
|
+ action === 'display' && subject === 'billing_schedules_settings_page',
|
|
|
+ )
|
|
|
+
|
|
|
+ expect(menuBuilder.build()).toEqual({
|
|
|
+ label: 'billing_schedules',
|
|
|
+ icon: undefined,
|
|
|
+ to: 'https://mydomain.com/#/bill_schedules/list/',
|
|
|
+ target: '_self',
|
|
|
+ type: MENU_LINK_TYPE.V1,
|
|
|
+ active: false,
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ test('has only rights for menu pseudonymization', () => {
|
|
|
+ ability.can = vi.fn(
|
|
|
+ (action: string, subject: string) =>
|
|
|
+ action === 'display' && subject === 'pseudonymization_page',
|
|
|
+ )
|
|
|
+
|
|
|
+ expect(menuBuilder.build()).toEqual({
|
|
|
+ label: 'pseudonymization',
|
|
|
+ icon: undefined,
|
|
|
+ to: 'https://mydomain.com/#/pseudonymizationList/list/',
|
|
|
+ target: '_self',
|
|
|
+ type: MENU_LINK_TYPE.V1,
|
|
|
+ active: false,
|
|
|
+ })
|
|
|
+ })
|
|
|
})
|