|
1 | 1 | import { buildMenuStructure } from './menu.structure'; |
2 | 2 | import { MenuID } from './menu-id.model'; |
3 | | -import { MenuProviderService } from './menu-provider.service'; |
4 | 3 | import { MenuRoute } from './menu-route.model'; |
5 | 4 | import { AccessControlMenuProvider } from './providers/access-control.menu'; |
6 | 5 | import { AdminSearchMenuProvider } from './providers/admin-search.menu'; |
@@ -101,18 +100,17 @@ describe('buildMenuStructure', () => { |
101 | 100 | ]; |
102 | 101 |
|
103 | 102 |
|
104 | | - it('should have a double amount of objects with an additional service after the processing', () => { |
| 103 | + it('should have a double amount of objects after the processing', () => { |
105 | 104 | const result = buildMenuStructure(providerStructure); |
106 | | - expect(result.length).toEqual(orderedProviderTypeList.length * 2 + 1); |
| 105 | + expect(result.length).toEqual(orderedProviderTypeList.length * 2); |
107 | 106 | }); |
108 | 107 |
|
109 | | - it('should return a list with the MenuProviderService and then a resolved provider and provider type for each provider in the provided structure', () => { |
| 108 | + it('should return a list with a resolved provider and provider type for each provider in the provided structure', () => { |
110 | 109 | const result = buildMenuStructure(providerStructure); |
111 | | - expect(result[0]).toEqual(MenuProviderService); |
112 | 110 |
|
113 | 111 | orderedProviderTypeList.forEach((provider, index) => { |
114 | | - expect((result[(index + 1) * 2 - 1] as any).deps).toEqual([provider]); |
115 | | - expect(result[(index + 1) * 2]).toEqual(provider); |
| 112 | + expect((result[index * 2] as any).deps).toEqual([provider]); |
| 113 | + expect(result[index * 2 + 1]).toEqual(provider); |
116 | 114 | }); |
117 | 115 | }); |
118 | 116 | }); |
0 commit comments