File tree Expand file tree Collapse file tree 6 files changed +31
-6
lines changed Expand file tree Collapse file tree 6 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 2020 "build" : " ng build" ,
2121 "build-lib" : " ng build @coreui/angular --prod" ,
2222 "test" : " ng test" ,
23+ "test-lib" : " ng test @coreui/angular" ,
2324 "lint" : " ng lint" ,
2425 "e2e" : " ng e2e" ,
2526 "publish" : " cd dist/@coreui/angular/ && npm publish" ,
Original file line number Diff line number Diff line change 1+ import { NO_ERRORS_SCHEMA } from '@angular/core' ;
12import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
3+ import { RouterTestingModule } from '@angular/router/testing' ;
24
35import { AppSidebarNavComponent } from './app-sidebar-nav.component' ;
46
@@ -8,7 +10,9 @@ describe('AppSidebarNavComponent', () => {
810
911 beforeEach ( async ( ( ) => {
1012 TestBed . configureTestingModule ( {
11- declarations : [ AppSidebarNavComponent ]
13+ declarations : [ AppSidebarNavComponent ] ,
14+ imports : [ RouterTestingModule ] ,
15+ schemas : [ NO_ERRORS_SCHEMA ] ,
1216 } )
1317 . compileComponents ( ) ;
1418 } ) ) ;
Original file line number Diff line number Diff line change 1+ import { SidebarNavHelper } from '../app-sidebar-nav.service' ;
12import { AppSidebarNavItemClassPipe } from './app-sidebar-nav-item-class.pipe' ;
23
34describe ( 'SidebarNavItemClassPipe' , ( ) => {
45 it ( 'create an instance' , ( ) => {
5- const pipe = new AppSidebarNavItemClassPipe ( ) ;
6+ const pipe = new AppSidebarNavItemClassPipe ( new SidebarNavHelper ( ) ) ;
67 expect ( pipe ) . toBeTruthy ( ) ;
78 } ) ;
89} ) ;
Original file line number Diff line number Diff line change 1+ import { NO_ERRORS_SCHEMA } from '@angular/core' ;
12import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
2-
3+ import { SidebarNavHelper } from '../app-sidebar-nav.service' ;
4+ import { AppSidebarNavBadgePipe } from './app-sidebar-nav-badge.pipe' ;
35import { AppSidebarNavLabelComponent } from './app-sidebar-nav-label.component' ;
46
57describe ( 'AppSidebarNavLabelComponent' , ( ) => {
@@ -8,14 +10,17 @@ describe('AppSidebarNavLabelComponent', () => {
810
911 beforeEach ( async ( ( ) => {
1012 TestBed . configureTestingModule ( {
11- declarations : [ AppSidebarNavLabelComponent ]
13+ declarations : [ AppSidebarNavLabelComponent , AppSidebarNavBadgePipe ] ,
14+ providers : [ SidebarNavHelper ] ,
15+ schemas : [ NO_ERRORS_SCHEMA ] ,
1216 } )
1317 . compileComponents ( ) ;
1418 } ) ) ;
1519
1620 beforeEach ( ( ) => {
1721 fixture = TestBed . createComponent ( AppSidebarNavLabelComponent ) ;
1822 component = fixture . componentInstance ;
23+ component . item = { } ;
1924 fixture . detectChanges ( ) ;
2025 } ) ;
2126
Original file line number Diff line number Diff line change 1+ import { NO_ERRORS_SCHEMA } from '@angular/core' ;
12import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
3+ import { RouterTestingModule } from '@angular/router/testing' ;
24
5+ import { AppSidebarNavBadgePipe } from './app-sidebar-nav-badge.pipe' ;
36import { AppSidebarNavLinkComponent } from './app-sidebar-nav-link.component' ;
7+ import { AppSidebarNavLinkPipe } from './app-sidebar-nav-link.pipe' ;
48
59describe ( 'AppSidebarNavLinkComponent' , ( ) => {
610 let component : AppSidebarNavLinkComponent ;
711 let fixture : ComponentFixture < AppSidebarNavLinkComponent > ;
812
913 beforeEach ( async ( ( ) => {
1014 TestBed . configureTestingModule ( {
11- declarations : [ AppSidebarNavLinkComponent ]
15+ declarations : [
16+ AppSidebarNavLinkComponent ,
17+ AppSidebarNavLinkPipe ,
18+ AppSidebarNavBadgePipe ,
19+ ] ,
20+ imports : [ RouterTestingModule ] ,
21+ schemas : [ NO_ERRORS_SCHEMA ] ,
1222 } )
1323 . compileComponents ( ) ;
1424 } ) ) ;
1525
1626 beforeEach ( ( ) => {
1727 fixture = TestBed . createComponent ( AppSidebarNavLinkComponent ) ;
1828 component = fixture . componentInstance ;
29+ component . item = {
30+ url : '' ,
31+ } ;
1932 fixture . detectChanges ( ) ;
2033 } ) ;
2134
Original file line number Diff line number Diff line change @@ -8,14 +8,15 @@ describe('AppSidebarNavTitleComponent', () => {
88
99 beforeEach ( async ( ( ) => {
1010 TestBed . configureTestingModule ( {
11- declarations : [ AppSidebarNavTitleComponent ]
11+ declarations : [ AppSidebarNavTitleComponent ] ,
1212 } )
1313 . compileComponents ( ) ;
1414 } ) ) ;
1515
1616 beforeEach ( ( ) => {
1717 fixture = TestBed . createComponent ( AppSidebarNavTitleComponent ) ;
1818 component = fixture . componentInstance ;
19+ component . item = { } ;
1920 fixture . detectChanges ( ) ;
2021 } ) ;
2122
You can’t perform that action at this time.
0 commit comments