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 20
20
"build" : " ng build" ,
21
21
"build-lib" : " ng build @coreui/angular --prod" ,
22
22
"test" : " ng test" ,
23
+ "test-lib" : " ng test @coreui/angular" ,
23
24
"lint" : " ng lint" ,
24
25
"e2e" : " ng e2e" ,
25
26
"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' ;
1
2
import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
3
+ import { RouterTestingModule } from '@angular/router/testing' ;
2
4
3
5
import { AppSidebarNavComponent } from './app-sidebar-nav.component' ;
4
6
@@ -8,9 +10,11 @@ describe('AppSidebarNavComponent', () => {
8
10
9
11
beforeEach ( async ( ( ) => {
10
12
TestBed . configureTestingModule ( {
11
- declarations : [ AppSidebarNavComponent ]
13
+ declarations : [ AppSidebarNavComponent ] ,
14
+ imports : [ RouterTestingModule ] ,
15
+ schemas : [ NO_ERRORS_SCHEMA ] ,
12
16
} )
13
- . compileComponents ( ) ;
17
+ . compileComponents ( ) ;
14
18
} ) ) ;
15
19
16
20
beforeEach ( ( ) => {
Original file line number Diff line number Diff line change
1
+ import { SidebarNavHelper } from '../app-sidebar-nav.service' ;
1
2
import { AppSidebarNavItemClassPipe } from './app-sidebar-nav-item-class.pipe' ;
2
3
3
4
describe ( 'SidebarNavItemClassPipe' , ( ) => {
4
5
it ( 'create an instance' , ( ) => {
5
- const pipe = new AppSidebarNavItemClassPipe ( ) ;
6
+ const pipe = new AppSidebarNavItemClassPipe ( new SidebarNavHelper ( ) ) ;
6
7
expect ( pipe ) . toBeTruthy ( ) ;
7
8
} ) ;
8
9
} ) ;
Original file line number Diff line number Diff line change
1
+ import { NO_ERRORS_SCHEMA } from '@angular/core' ;
1
2
import { 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' ;
3
5
import { AppSidebarNavLabelComponent } from './app-sidebar-nav-label.component' ;
4
6
5
7
describe ( 'AppSidebarNavLabelComponent' , ( ) => {
@@ -8,14 +10,17 @@ describe('AppSidebarNavLabelComponent', () => {
8
10
9
11
beforeEach ( async ( ( ) => {
10
12
TestBed . configureTestingModule ( {
11
- declarations : [ AppSidebarNavLabelComponent ]
13
+ declarations : [ AppSidebarNavLabelComponent , AppSidebarNavBadgePipe ] ,
14
+ providers : [ SidebarNavHelper ] ,
15
+ schemas : [ NO_ERRORS_SCHEMA ] ,
12
16
} )
13
- . compileComponents ( ) ;
17
+ . compileComponents ( ) ;
14
18
} ) ) ;
15
19
16
20
beforeEach ( ( ) => {
17
21
fixture = TestBed . createComponent ( AppSidebarNavLabelComponent ) ;
18
22
component = fixture . componentInstance ;
23
+ component . item = { } ;
19
24
fixture . detectChanges ( ) ;
20
25
} ) ;
21
26
Original file line number Diff line number Diff line change
1
+ import { NO_ERRORS_SCHEMA } from '@angular/core' ;
1
2
import { async , ComponentFixture , TestBed } from '@angular/core/testing' ;
2
-
3
+ import { RouterTestingModule } from '@angular/router/testing' ;
4
+ import { AppSidebarNavBadgePipe } from './app-sidebar-nav-badge.pipe' ;
3
5
import { AppSidebarNavLinkComponent } from './app-sidebar-nav-link.component' ;
6
+ import { AppSidebarNavLinkPipe } from './app-sidebar-nav-link.pipe' ;
4
7
5
8
describe ( 'AppSidebarNavLinkComponent' , ( ) => {
6
9
let component : AppSidebarNavLinkComponent ;
7
10
let fixture : ComponentFixture < AppSidebarNavLinkComponent > ;
8
11
9
12
beforeEach ( async ( ( ) => {
10
13
TestBed . configureTestingModule ( {
11
- declarations : [ AppSidebarNavLinkComponent ]
14
+ declarations : [
15
+ AppSidebarNavLinkComponent ,
16
+ AppSidebarNavLinkPipe ,
17
+ AppSidebarNavBadgePipe ,
18
+ ] ,
19
+ imports : [ RouterTestingModule ] ,
20
+ schemas : [ NO_ERRORS_SCHEMA ] ,
12
21
} )
13
- . compileComponents ( ) ;
22
+ . compileComponents ( ) ;
14
23
} ) ) ;
15
24
16
25
beforeEach ( ( ) => {
17
26
fixture = TestBed . createComponent ( AppSidebarNavLinkComponent ) ;
18
27
component = fixture . componentInstance ;
28
+ component . item = {
29
+ url : '' ,
30
+ } ;
19
31
fixture . detectChanges ( ) ;
20
32
} ) ;
21
33
Original file line number Diff line number Diff line change @@ -8,14 +8,15 @@ describe('AppSidebarNavTitleComponent', () => {
8
8
9
9
beforeEach ( async ( ( ) => {
10
10
TestBed . configureTestingModule ( {
11
- declarations : [ AppSidebarNavTitleComponent ]
11
+ declarations : [ AppSidebarNavTitleComponent ] ,
12
12
} )
13
- . compileComponents ( ) ;
13
+ . compileComponents ( ) ;
14
14
} ) ) ;
15
15
16
16
beforeEach ( ( ) => {
17
17
fixture = TestBed . createComponent ( AppSidebarNavTitleComponent ) ;
18
18
component = fixture . componentInstance ;
19
+ component . item = { } ;
19
20
fixture . detectChanges ( ) ;
20
21
} ) ;
21
22
You can’t perform that action at this time.
0 commit comments