Skip to content

Commit 8096f42

Browse files
committed
chore: sync with branch v5.0
2 parents 40f7429 + 6eefbb5 commit 8096f42

File tree

83 files changed

+656
-308
lines changed

Some content is hidden

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

83 files changed

+656
-308
lines changed

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
### [@coreui/angular](https://coreui.io/angular/) changelog
22

3+
4+
---
5+
6+
#### `5.0.3`
7+
8+
- chore(dependencies): update
9+
- test: add missing tests, refactor
10+
311
---
412

513
#### `5.0.2`

Diff for: package-lock.json

+234-234
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+18-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "coreui-angular-dev",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"description": "CoreUI Components Library for Angular",
55
"copyright": "Copyright 2024 creativeLabs Łukasz Holeczek",
66
"license": "MIT",
@@ -36,16 +36,16 @@
3636
},
3737
"private": true,
3838
"dependencies": {
39-
"@angular/animations": "^17.3.4",
40-
"@angular/cdk": "^17.3.4",
41-
"@angular/common": "^17.3.4",
42-
"@angular/compiler": "^17.3.4",
43-
"@angular/core": "^17.3.4",
44-
"@angular/forms": "^17.3.4",
45-
"@angular/localize": "^17.3.4",
46-
"@angular/platform-browser": "^17.3.4",
47-
"@angular/platform-browser-dynamic": "^17.3.4",
48-
"@angular/router": "^17.3.4",
39+
"@angular/animations": "^17.3.5",
40+
"@angular/cdk": "^17.3.5",
41+
"@angular/common": "^17.3.5",
42+
"@angular/compiler": "^17.3.5",
43+
"@angular/core": "^17.3.5",
44+
"@angular/forms": "^17.3.5",
45+
"@angular/localize": "^17.3.5",
46+
"@angular/platform-browser": "^17.3.5",
47+
"@angular/platform-browser-dynamic": "^17.3.5",
48+
"@angular/router": "^17.3.5",
4949
"@coreui/chartjs": "^4.0.0",
5050
"@coreui/icons": "^3.0.1",
5151
"@popperjs/core": "~2.11.8",
@@ -56,20 +56,20 @@
5656
"zone.js": "~0.14.4"
5757
},
5858
"devDependencies": {
59-
"@angular-devkit/build-angular": "^17.3.4",
59+
"@angular-devkit/build-angular": "^17.3.5",
6060
"@angular-eslint/builder": "^17.3.0",
6161
"@angular-eslint/eslint-plugin": "^17.3.0",
6262
"@angular-eslint/eslint-plugin-template": "^17.3.0",
6363
"@angular-eslint/schematics": "^17.3.0",
6464
"@angular-eslint/template-parser": "^17.3.0",
65-
"@angular/cli": "^17.3.4",
66-
"@angular/compiler-cli": "^17.3.4",
67-
"@angular/language-service": "^17.3.4",
65+
"@angular/cli": "^17.3.5",
66+
"@angular/compiler-cli": "^17.3.5",
67+
"@angular/language-service": "^17.3.5",
6868
"@types/jasmine": "^5.1.4",
6969
"@types/lodash-es": "^4.17.12",
7070
"@types/node": "^20.12.7",
71-
"@typescript-eslint/eslint-plugin": "^7.6.0",
72-
"@typescript-eslint/parser": "^7.6.0",
71+
"@typescript-eslint/eslint-plugin": "^7.7.0",
72+
"@typescript-eslint/parser": "^7.7.0",
7373
"eslint": "^8.57.0",
7474
"jasmine-core": "^5.1.2",
7575
"karma": "^6.4.3",
@@ -79,7 +79,7 @@
7979
"karma-jasmine-html-reporter": "^2.1.0",
8080
"ng-packagr": "^17.3.0",
8181
"prettier": "^3.2.5",
82-
"typescript": "~5.3.3"
82+
"typescript": "~5.4.2"
8383
},
8484
"keywords": [
8585
"angular",

Diff for: projects/coreui-angular-chartjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/angular-chartjs",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"description": "Angular wrapper component for Chart.js",
55
"copyright": "Copyright 2024 creativeLabs Łukasz Holeczek",
66
"license": "MIT",

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

+6
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
});

Diff for: projects/coreui-angular/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/angular",
3-
"version": "5.0.2",
3+
"version": "5.0.3",
44
"description": "CoreUI Components Library for Angular",
55
"copyright": "Copyright 2024 creativeLabs Łukasz Holeczek",
66
"license": "MIT",

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

+4
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
});

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

+4
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
});

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

+4
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
});

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

+4
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
});

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

+6-2
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
});

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

+4
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
});

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

+2-4
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

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

+2-2
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
});

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

+4
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
});

Diff for: projects/coreui-angular/src/lib/button-group/button-group/button-group.component.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('ButtonGroupComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('btn-group');
28+
});
2529
});

Diff for: projects/coreui-angular/src/lib/button-group/button-toolbar/button-toolbar.component.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('ButtonToolbarComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('btn-toolbar');
28+
});
2529
});

Diff for: projects/coreui-angular/src/lib/button/button-close.directive.spec.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,27 @@ import { By } from '@angular/platform-browser';
66
class MockElementRef extends ElementRef {}
77

88
@Component({
9-
template: '<button cButtonClose></button>'
9+
template: '<button cButtonClose></button>',
10+
standalone: true,
11+
imports: [ButtonCloseDirective]
1012
})
1113
class TestComponent {}
1214

1315
describe('ButtonCloseDirective', () => {
1416

1517
let component: TestComponent;
1618
let fixture: ComponentFixture<TestComponent>;
17-
let buttonEl: DebugElement;
19+
let elementRef: DebugElement;
1820

1921
beforeEach(() => {
2022
TestBed.configureTestingModule({
21-
declarations: [TestComponent],
22-
imports: [ButtonCloseDirective],
23+
imports: [TestComponent, ButtonCloseDirective],
2324
providers: [{ provide: ElementRef, useClass: MockElementRef }]
2425
});
2526

2627
fixture = TestBed.createComponent(TestComponent);
2728
component = fixture.componentInstance;
28-
buttonEl = fixture.debugElement.query(By.css('button'));
29+
elementRef = fixture.debugElement.query(By.directive(ButtonCloseDirective));
2930

3031
fixture.detectChanges(); // initial binding
3132
});
@@ -34,4 +35,9 @@ describe('ButtonCloseDirective', () => {
3435
const directive = new ButtonCloseDirective();
3536
expect(directive).toBeTruthy();
3637
});
38+
39+
it('should have css classes', () => {
40+
expect(elementRef.nativeElement).toHaveClass('btn');
41+
expect(elementRef.nativeElement).toHaveClass('btn-close');
42+
});
3743
});
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,32 @@
11
import { ButtonDirective } from './button.directive';
22
import { ComponentFixture, TestBed } from '@angular/core/testing';
3-
import { ButtonCloseDirective } from './button-close.directive';
43
import { Component, DebugElement, ElementRef } from '@angular/core';
54
import { By } from '@angular/platform-browser';
65

76
class MockElementRef extends ElementRef {}
87

98
@Component({
10-
template: `
11-
<button cButton></button>`
9+
template: '<button cButton color="info" size="lg"></button>',
10+
standalone: true,
11+
imports: [ButtonDirective]
1212
})
1313
class TestComponent {}
1414

1515
describe('ButtonDirective', () => {
1616

1717
let component: TestComponent;
1818
let fixture: ComponentFixture<TestComponent>;
19-
let buttonEl: DebugElement;
19+
let elementRef: DebugElement;
2020

2121
beforeEach(() => {
2222
TestBed.configureTestingModule({
23-
declarations: [TestComponent],
24-
imports: [ButtonCloseDirective],
23+
imports: [TestComponent, ButtonDirective],
2524
providers: [{ provide: ElementRef, useClass: MockElementRef }]
2625
});
2726

2827
fixture = TestBed.createComponent(TestComponent);
2928
component = fixture.componentInstance;
30-
buttonEl = fixture.debugElement.query(By.css('button'));
29+
elementRef = fixture.debugElement.query(By.directive(ButtonDirective));
3130

3231
fixture.detectChanges(); // initial binding
3332
});
@@ -36,4 +35,11 @@ describe('ButtonDirective', () => {
3635
const directive = new ButtonDirective();
3736
expect(directive).toBeTruthy();
3837
});
38+
39+
it('should have css classes', () => {
40+
expect(elementRef.nativeElement).toHaveClass('btn');
41+
expect(elementRef.nativeElement).toHaveClass('btn-lg');
42+
expect(elementRef.nativeElement).toHaveClass('btn-info');
43+
});
44+
3945
});

Diff for: projects/coreui-angular/src/lib/callout/callout.component.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('CalloutComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('callout');
28+
});
2529
});

Diff for: projects/coreui-angular/src/lib/card/card-body.component.spec.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ describe('CardBodyComponent', () => {
88

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

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

Diff for: projects/coreui-angular/src/lib/card/card-footer.component.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('CardFooterComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('card-footer');
28+
});
2529
});

Diff for: projects/coreui-angular/src/lib/card/card-group.component.spec.ts

+4
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,8 @@ describe('CardGroupComponent', () => {
2222
it('should create', () => {
2323
expect(component).toBeTruthy();
2424
});
25+
26+
it('should have css classes', () => {
27+
expect(fixture.nativeElement).toHaveClass('card-group');
28+
});
2529
});

0 commit comments

Comments
 (0)