Skip to content

Commit db90765

Browse files
committed
Merge branch 'test-lib' of Hagith/coreui-angular
2 parents b6d17f1 + 0dc1d15 commit db90765

File tree

6 files changed

+31
-6
lines changed

6 files changed

+31
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
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",

projects/coreui/angular/src/lib/sidebar/app-sidebar-nav.component.spec.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
import { NO_ERRORS_SCHEMA } from '@angular/core';
12
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
import { RouterTestingModule } from '@angular/router/testing';
24

35
import { 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
}));
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { SidebarNavHelper } from '../app-sidebar-nav.service';
12
import { AppSidebarNavItemClassPipe } from './app-sidebar-nav-item-class.pipe';
23

34
describe('SidebarNavItemClassPipe', () => {
45
it('create an instance', () => {
5-
const pipe = new AppSidebarNavItemClassPipe();
6+
const pipe = new AppSidebarNavItemClassPipe(new SidebarNavHelper());
67
expect(pipe).toBeTruthy();
78
});
89
});

projects/coreui/angular/src/lib/sidebar/app-sidebar-nav/app-sidebar-nav-label.component.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
import { NO_ERRORS_SCHEMA } from '@angular/core';
12
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';
35
import { AppSidebarNavLabelComponent } from './app-sidebar-nav-label.component';
46

57
describe('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

projects/coreui/angular/src/lib/sidebar/app-sidebar-nav/app-sidebar-nav-link.component.spec.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,34 @@
1+
import { NO_ERRORS_SCHEMA } from '@angular/core';
12
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
3+
import { RouterTestingModule } from '@angular/router/testing';
24

5+
import { AppSidebarNavBadgePipe } from './app-sidebar-nav-badge.pipe';
36
import { AppSidebarNavLinkComponent } from './app-sidebar-nav-link.component';
7+
import { AppSidebarNavLinkPipe } from './app-sidebar-nav-link.pipe';
48

59
describe('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

projects/coreui/angular/src/lib/sidebar/app-sidebar-nav/app-sidebar-nav-title.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)