1+ jest . mock ( '../components/generic-ui/detail-view/detail-view.component' , ( ) => ( {
2+ DetailViewComponent : class DetailViewComponent { } ,
3+ } ) ) ;
4+ jest . mock ( '../components/generic-ui/list-view/list-view.component' , ( ) => ( {
5+ ListViewComponent : class ListViewComponent { } ,
6+ } ) ) ;
7+ jest . mock ( '../components/organization-management/organization-management.component' , ( ) => ( {
8+ OrganizationManagementComponent : class OrganizationManagementComponent { } ,
9+ } ) ) ;
10+
111import { ApplicationInitStatus } from '@angular/core' ;
212import { TestBed } from '@angular/core/testing' ;
313
4- import { DetailViewComponent } from '../components/generic-ui/detail-view/detail-view.component' ;
5- import { ListViewComponent } from '../components/generic-ui/list-view/list-view.component' ;
614import { provideLuigiWebComponents } from './luigi-wc-initializer' ;
7-
8- import { OrganizationManagementComponent } from '../components/organization-management/organization-management.component' ;
915import * as wc from '../utils/wc' ;
1016
1117describe ( 'provideLuigiWebComponents' , ( ) => {
@@ -24,14 +30,11 @@ describe('provideLuigiWebComponents', () => {
2430
2531 expect ( spy ) . toHaveBeenCalledTimes ( 1 ) ;
2632
27- const expectedMap = {
28- 'generic-list-view' : ListViewComponent ,
29- 'generic-detail-view' : DetailViewComponent ,
30- 'organization-management' : OrganizationManagementComponent ,
31- } as Record < string , any > ;
32-
33- // Validate first arg equals the components map
34- expect ( spy . mock . calls [ 0 ] [ 0 ] ) . toEqual ( expectedMap ) ;
33+ const componentsMap = spy . mock . calls [ 0 ] [ 0 ] as Record < string , any > ;
34+ expect ( componentsMap ) . toBeTruthy ( ) ;
35+ expect ( Object . keys ( componentsMap ) . sort ( ) ) . toEqual (
36+ [ 'generic-detail-view' , 'generic-list-view' , 'organization-management' ] . sort ( ) ,
37+ ) ;
3538
3639 // Validate second arg looks like an Injector
3740 const passedInjector = spy . mock . calls [ 0 ] [ 1 ] ;
0 commit comments