|
|
@@ -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(16)
|
|
|
+ expect(result.children.length).toEqual(17)
|
|
|
})
|
|
|
|
|
|
test('has no items', () => {
|
|
|
@@ -67,14 +67,17 @@ describe('build', () => {
|
|
|
)
|
|
|
organizationProfile.id = 123
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'organization_page',
|
|
|
- icon: undefined,
|
|
|
- to: 'https://mydomain.com/#/main/organizations/123/dashboard',
|
|
|
- target: '_self',
|
|
|
- type: MENU_LINK_TYPE.V1,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'organization_page')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/main/organizations/123/dashboard',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu cmf_licence_generate', () => {
|
|
|
@@ -83,14 +86,17 @@ describe('build', () => {
|
|
|
action === 'display' && subject === 'cmf_licence_page',
|
|
|
)
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'cmf_licence_generate',
|
|
|
- icon: undefined,
|
|
|
- to: 'https://mydomain.com/#/licence_cmf/organization',
|
|
|
- target: '_self',
|
|
|
- type: MENU_LINK_TYPE.V1,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'cmf_licence_generate')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/licence_cmf/organization',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
//
|
|
|
// expect(menuBuilder.build()).toEqual({
|
|
|
// label: 'cmf_licence_generate',
|
|
|
@@ -109,13 +115,12 @@ describe('build', () => {
|
|
|
|
|
|
menuBuilder.organizationProfile.id = 123
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'parameters_page',
|
|
|
- icon: undefined,
|
|
|
- to: undefined,
|
|
|
- type: MENU_LINK_TYPE.INTERNAL,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'parameters_page')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.INTERNAL)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', true)
|
|
|
|
|
|
// expect(menuBuilder.build()).toEqual({
|
|
|
// label: 'parameters',
|
|
|
@@ -132,14 +137,14 @@ describe('build', () => {
|
|
|
action === 'display' && subject === 'place_page',
|
|
|
)
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'places',
|
|
|
- icon: undefined,
|
|
|
- to: 'https://mydomain.com/#/places/list/',
|
|
|
- target: '_self',
|
|
|
- type: MENU_LINK_TYPE.V1,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'places')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty('to', 'https://mydomain.com/#/places/list/')
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu education', () => {
|
|
|
@@ -148,14 +153,17 @@ describe('build', () => {
|
|
|
action === 'display' && subject === 'education_page',
|
|
|
)
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'education',
|
|
|
- icon: undefined,
|
|
|
- to: 'https://mydomain.com/#/educations/list/',
|
|
|
- target: '_self',
|
|
|
- type: MENU_LINK_TYPE.V1,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'education')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/educations/list/',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu tag', () => {
|
|
|
@@ -164,14 +172,14 @@ describe('build', () => {
|
|
|
action === 'display' && subject === 'tag_page',
|
|
|
)
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'tags',
|
|
|
- icon: undefined,
|
|
|
- to: 'https://mydomain.com/#/taggs/list/',
|
|
|
- target: '_self',
|
|
|
- type: MENU_LINK_TYPE.V1,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'tags')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty('to', 'https://mydomain.com/#/taggs/list/')
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu activities', () => {
|
|
|
@@ -180,14 +188,17 @@ describe('build', () => {
|
|
|
action === 'display' && subject === 'activities_page',
|
|
|
)
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'activities',
|
|
|
- icon: undefined,
|
|
|
- to: 'https://mydomain.com/#/activities/list/',
|
|
|
- target: '_self',
|
|
|
- type: MENU_LINK_TYPE.V1,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'activities')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/activities/list/',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu course_duplication', () => {
|
|
|
@@ -196,14 +207,17 @@ describe('build', () => {
|
|
|
action === 'display' && subject === 'course_duplication_page',
|
|
|
)
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'course_duplication',
|
|
|
- icon: undefined,
|
|
|
- to: 'https://mydomain.com/#/duplicate_courses',
|
|
|
- target: '_self',
|
|
|
- type: MENU_LINK_TYPE.V1,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'course_duplication')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/duplicate_courses',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', true)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu import', () => {
|
|
|
@@ -212,14 +226,14 @@ describe('build', () => {
|
|
|
action === 'display' && subject === 'import_page',
|
|
|
)
|
|
|
|
|
|
- expect(menuBuilder.build()).toEqual({
|
|
|
- label: 'import',
|
|
|
- icon: undefined,
|
|
|
- to: 'https://mydomain.com/#/import/all',
|
|
|
- target: '_self',
|
|
|
- type: MENU_LINK_TYPE.V1,
|
|
|
- active: false,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'import')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty('to', 'https://mydomain.com/#/import/all')
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu parcours', () => {
|
|
|
@@ -228,14 +242,17 @@ describe('build', () => {
|
|
|
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,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'parcours')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/family_quotient_models/list/',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu family_quotient_models', () => {
|
|
|
@@ -244,14 +261,17 @@ describe('build', () => {
|
|
|
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,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'family_quotient_models')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/family_quotient_models/list/',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu billing_schedules', () => {
|
|
|
@@ -260,14 +280,17 @@ describe('build', () => {
|
|
|
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,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'billing_schedules')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/bill_schedules/list/',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', true)
|
|
|
})
|
|
|
|
|
|
test('has only rights for menu pseudonymization', () => {
|
|
|
@@ -276,13 +299,16 @@ describe('build', () => {
|
|
|
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,
|
|
|
- })
|
|
|
+ const result = menuBuilder.build()
|
|
|
+ expect(result).toHaveProperty('label', 'pseudonymization')
|
|
|
+ expect(result).toHaveProperty('icon', undefined)
|
|
|
+ expect(result).toHaveProperty(
|
|
|
+ 'to',
|
|
|
+ 'https://mydomain.com/#/pseudonymizationList/list/',
|
|
|
+ )
|
|
|
+ expect(result).toHaveProperty('target', '_self')
|
|
|
+ expect(result).toHaveProperty('type', MENU_LINK_TYPE.V1)
|
|
|
+ expect(result).toHaveProperty('active', false)
|
|
|
+ expect(result).toHaveProperty('endOfSubsection', false)
|
|
|
})
|
|
|
})
|