Skip to content

Commit a4b90bf

Browse files
committed
test: add some missing css classes tests, refactor
1 parent 1a44a7c commit a4b90bf

File tree

77 files changed

+393
-53
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+393
-53
lines changed

projects/coreui-angular-chartjs/src/lib/chartjs.component.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ describe('ChartjsComponent', () => {
4040
component = fixture.componentInstance;
4141
component.data = undefined;
4242
component.type = 'line';
43+
component.wrapper = true;
4344
});
4445

4546
it('chart should create', fakeAsync(() => {
@@ -83,4 +84,9 @@ describe('ChartjsComponent', () => {
8384
expect(component.chart?.config?.data.labels?.length).toBe(5);
8485
expect(component.chart?.config?.data.datasets[1]?.data.length).toBe(5);
8586
}));
87+
88+
it('should have css classes', () => {
89+
fixture.detectChanges();
90+
expect(fixture.nativeElement).toHaveClass('chart-wrapper');
91+
});
8692
});

projects/coreui-angular/src/lib/accordion/accordion-item/accordion-item.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ describe('AccordionItemComponent', () => {
2525
it('should create', () => {
2626
expect(component).toBeTruthy();
2727
});
28+
29+
it('should have css classes', () => {
30+
expect(fixture.nativeElement).toHaveClass('accordion-item');
31+
});
2832
});

projects/coreui-angular/src/lib/accordion/accordion/accordion.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('AccordionComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('accordion');
28+
});
2529
});

projects/coreui-angular/src/lib/alert/alert.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,8 @@ describe('AlertComponent', () => {
2323
it('should create', () => {
2424
expect(component).toBeTruthy();
2525
});
26+
27+
it('should have css classes', () => {
28+
expect(fixture.nativeElement).toHaveClass('alert');
29+
});
2630
});

projects/coreui-angular/src/lib/avatar/avatar.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('AvatarComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('avatar');
28+
});
2529
});

projects/coreui-angular/src/lib/badge/badge.component.spec.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ describe('BadgeComponent', () => {
88

99
beforeEach(async () => {
1010
await TestBed.configureTestingModule({
11-
imports: [ BadgeComponent ]
11+
imports: [BadgeComponent]
1212
})
13-
.compileComponents();
13+
.compileComponents();
1414
});
1515

1616
beforeEach(() => {
@@ -22,4 +22,8 @@ describe('BadgeComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('badge');
28+
});
2529
});

projects/coreui-angular/src/lib/breadcrumb/breadcrumb-item/breadcrumb-item.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('BreadcrumbItemComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('breadcrumb-item');
28+
});
2529
});

projects/coreui-angular/src/lib/breadcrumb/breadcrumb-router/breadcrumb-router.component.spec.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
2-
import { RouterTestingModule } from '@angular/router/testing';
3-
import { Router } from '@angular/router';
2+
import { provideRouter, Router } from '@angular/router';
43

54
import { BreadcrumbRouterComponent } from './breadcrumb-router.component';
65
import { BreadcrumbRouterService } from './breadcrumb-router.service';
@@ -13,10 +12,9 @@ describe('BreadcrumbComponent', () => {
1312
beforeEach(waitForAsync(() => {
1413
TestBed.configureTestingModule({
1514
imports: [
16-
RouterTestingModule.withRoutes([]),
1715
BreadcrumbRouterComponent
1816
],
19-
providers: [BreadcrumbRouterService]
17+
providers: [BreadcrumbRouterService, provideRouter([])]
2018
}).compileComponents();
2119
}));
2220

projects/coreui-angular/src/lib/breadcrumb/breadcrumb-router/breadcrumb-router.service.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import { TestBed } from '@angular/core/testing';
2-
import { RouterTestingModule } from '@angular/router/testing';
32

43
import { BreadcrumbRouterService } from './breadcrumb-router.service';
4+
import { provideRouter } from '@angular/router';
55

66
describe('AppBreadcrumbService', () => {
77
let service: BreadcrumbRouterService;
88

99
beforeEach(() => {
1010
TestBed.configureTestingModule({
11-
imports: [RouterTestingModule.withRoutes([])]
11+
providers: [provideRouter([])]
1212
});
1313
service = TestBed.inject(BreadcrumbRouterService);
1414
});

projects/coreui-angular/src/lib/breadcrumb/breadcrumb/breadcrumb.component.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('BreadcrumbComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('breadcrumb');
28+
});
2529
});

0 commit comments

Comments
 (0)