File tree Expand file tree Collapse file tree 6 files changed +35
-11
lines changed
Expand file tree Collapse file tree 6 files changed +35
-11
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,9 +10,11 @@ describe('AppSidebarNavComponent', () => {
810
911 beforeEach ( async ( ( ) => {
1012 TestBed . configureTestingModule ( {
11- declarations : [ AppSidebarNavComponent ]
13+ declarations : [ AppSidebarNavComponent ] ,
14+ imports : [ RouterTestingModule ] ,
15+ schemas : [ NO_ERRORS_SCHEMA ] ,
1216 } )
13- . compileComponents ( ) ;
17+ . compileComponents ( ) ;
1418 } ) ) ;
1519
1620 beforeEach ( ( ) => {
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 } )
13- . compileComponents ( ) ;
17+ . 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' ;
2-
3+ import { RouterTestingModule } from '@angular/router/testing' ;
4+ import { AppSidebarNavBadgePipe } from './app-sidebar-nav-badge.pipe' ;
35import { AppSidebarNavLinkComponent } from './app-sidebar-nav-link.component' ;
6+ import { AppSidebarNavLinkPipe } from './app-sidebar-nav-link.pipe' ;
47
58describe ( 'AppSidebarNavLinkComponent' , ( ) => {
69 let component : AppSidebarNavLinkComponent ;
710 let fixture : ComponentFixture < AppSidebarNavLinkComponent > ;
811
912 beforeEach ( async ( ( ) => {
1013 TestBed . configureTestingModule ( {
11- declarations : [ AppSidebarNavLinkComponent ]
14+ declarations : [
15+ AppSidebarNavLinkComponent ,
16+ AppSidebarNavLinkPipe ,
17+ AppSidebarNavBadgePipe ,
18+ ] ,
19+ imports : [ RouterTestingModule ] ,
20+ schemas : [ NO_ERRORS_SCHEMA ] ,
1221 } )
13- . compileComponents ( ) ;
22+ . compileComponents ( ) ;
1423 } ) ) ;
1524
1625 beforeEach ( ( ) => {
1726 fixture = TestBed . createComponent ( AppSidebarNavLinkComponent ) ;
1827 component = fixture . componentInstance ;
28+ component . item = {
29+ url : '' ,
30+ } ;
1931 fixture . detectChanges ( ) ;
2032 } ) ;
2133
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 } )
13- . compileComponents ( ) ;
13+ . 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