Skip to content

Commit 97a6df1

Browse files
committed
chore: update configs and tests, cleanups
1 parent a8297d3 commit 97a6df1

File tree

15 files changed

+78
-114
lines changed

15 files changed

+78
-114
lines changed

angular.json

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": 1,
44
"newProjectRoot": "projects",
55
"projects": {
6-
"coreui": {
6+
"coreui-demo": {
77
"projectType": "application",
88
"schematics": {
99
"@schematics/angular:component": {
@@ -20,10 +20,14 @@
2020
"build": {
2121
"builder": "@angular-devkit/build-angular:browser",
2222
"options": {
23-
"outputPath": "dist/coreui/demo",
23+
"outputPath": "dist/coreui-demo",
2424
"index": "src/index.html",
2525
"main": "src/main.ts",
26-
"polyfills": "src/polyfills.ts",
26+
"polyfills": [
27+
"@angular/localize/init",
28+
"zone.js",
29+
"zone.js/testing"
30+
],
2731
"tsConfig": "src/tsconfig.app.json",
2832
"inlineStyleLanguage": "scss",
2933
"assets": [
@@ -73,25 +77,29 @@
7377
"builder": "@angular-devkit/build-angular:dev-server",
7478
"configurations": {
7579
"production": {
76-
"buildTarget": "coreui:build:production"
80+
"buildTarget": "coreui-demo:build:production"
7781
},
7882
"development": {
79-
"buildTarget": "coreui:build:development"
83+
"buildTarget": "coreui-demo:build:development"
8084
}
8185
},
8286
"defaultConfiguration": "development"
8387
},
8488
"extract-i18n": {
8589
"builder": "@angular-devkit/build-angular:extract-i18n",
8690
"options": {
87-
"buildTarget": "coreui:build"
91+
"buildTarget": "coreui-demo:build"
8892
}
8993
},
9094
"test": {
9195
"builder": "@angular-devkit/build-angular:karma",
9296
"options": {
9397
"main": "src/test.ts",
94-
"polyfills": "src/polyfills.ts",
98+
"polyfills": [
99+
"@angular/localize/init",
100+
"zone.js",
101+
"zone.js/testing"
102+
],
95103
"tsConfig": "src/tsconfig.spec.json",
96104
"karmaConfig": "src/karma.conf.js",
97105
"inlineStyleLanguage": "scss",
@@ -108,11 +116,11 @@
108116
"cypress-run": {
109117
"builder": "@cypress/schematic:cypress",
110118
"options": {
111-
"devServerTarget": "coreui:serve"
119+
"devServerTarget": "coreui-demo:serve"
112120
},
113121
"configurations": {
114122
"production": {
115-
"devServerTarget": "coreui:serve:production"
123+
"devServerTarget": "coreui-demo:serve:production"
116124
}
117125
}
118126
},
@@ -126,13 +134,13 @@
126134
"e2e": {
127135
"builder": "@cypress/schematic:cypress",
128136
"options": {
129-
"devServerTarget": "coreui:serve",
137+
"devServerTarget": "coreui-demo:serve",
130138
"watch": false,
131139
"headless": true
132140
},
133141
"configurations": {
134142
"production": {
135-
"devServerTarget": "coreui:serve:production"
143+
"devServerTarget": "coreui-demo:serve:production"
136144
}
137145
}
138146
}

cypress/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"compilerOptions": {
55
"sourceMap": false,
66
"types": ["cypress"],
7-
}
7+
},
8+
"exclude": [],
89
}

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

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

44
import { CuiBreadcrumbComponent } from './cui-breadcrumb.component';
55

@@ -9,7 +9,7 @@ describe('CuiBreadcrumbComponent', () => {
99

1010
beforeEach(waitForAsync(() => {
1111
TestBed.configureTestingModule({
12-
imports: [RouterTestingModule.withRoutes([]), CuiBreadcrumbComponent],
12+
imports: [RouterModule.forRoot([]), CuiBreadcrumbComponent],
1313
})
1414
.compileComponents();
1515
}));

src/app/app.component.spec.ts

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
import { RouterTestingModule } from '@angular/router/testing';
2-
import { TestBed, waitForAsync } from '@angular/core/testing';
3-
import { AppComponent } from './app.component';
1+
import {TestBed, waitForAsync} from '@angular/core/testing';
2+
import {RouterModule} from "@angular/router";
3+
import {AppComponent} from './app.component';
4+
45
describe('AppComponent', () => {
5-
beforeEach(waitForAsync(() => {
6-
TestBed.configureTestingModule({
7-
declarations: [
8-
AppComponent
9-
],
10-
imports: [ RouterTestingModule ]
6+
beforeEach(async () => {
7+
await TestBed.configureTestingModule({
8+
declarations: [AppComponent],
9+
imports: [RouterModule]
1110
}).compileComponents();
12-
}));
11+
});
12+
1313
it('should create the app', waitForAsync(() => {
1414
const fixture = TestBed.createComponent(AppComponent);
15-
const app = fixture.debugElement.componentInstance;
15+
const app = fixture.componentInstance;
1616
expect(app).toBeTruthy();
1717
}));
18+
19+
it(`should have as title 'CoreUI Angular Admin Template'`, () => {
20+
const fixture = TestBed.createComponent(AppComponent);
21+
const app = fixture.componentInstance;
22+
expect(app.title).toEqual('CoreUI 2 for Angular 18');
23+
});
1824
});

src/app/app.component.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
import { Component, OnInit } from '@angular/core';
2-
import { Router, NavigationEnd } from '@angular/router';
1+
import {Component, OnInit} from '@angular/core';
2+
import {NavigationEnd, Router} from '@angular/router';
33

44
@Component({
5-
// tslint:disable-next-line
6-
selector: 'body',
7-
template: '<router-outlet></router-outlet>'
5+
selector: 'app-root',
6+
template: '<router-outlet />',
7+
standalone: false
88
})
99
export class AppComponent implements OnInit {
10-
title = 'CoreUI 2 for Angular 15';
11-
constructor(private router: Router) { }
10+
title = 'CoreUI 2 for Angular 18';
11+
12+
constructor(private router: Router) {}
1213

1314
ngOnInit() {
1415
this.router.events.subscribe((evt) => {

src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { BrowserModule } from '@angular/platform-browser';
21
import { NgModule } from '@angular/core';
32
import { LocationStrategy, HashLocationStrategy } from '@angular/common';
3+
import { BrowserModule } from '@angular/platform-browser';
44
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
55

66
import { AppComponent } from './app.component';

src/app/app.routing.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const routes: Routes = [
3131
];
3232

3333
@NgModule({
34-
imports: [ RouterModule.forRoot(routes, {}) ],
34+
imports: [ RouterModule.forRoot(routes) ],
3535
exports: [ RouterModule ]
3636
})
3737
export class AppRoutingModule {}

src/app/containers/default-layout/default-layout.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
</app-aside>
2828
</div>
2929
<app-footer>
30-
<span><a href="https://coreui.io">CoreUI</a> &copy; 2024 creativeLabs.</span>
30+
<span><a href="https://coreui.io">CoreUI</a> &copy; 2025 creativeLabs.</span>
3131
<span class="ml-auto">Powered by <a href="https://coreui.io/angular">CoreUI 2 for Angular</a></span>
3232
</app-footer>

src/main.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/// <reference types="@angular/localize" />
2+
13
import { enableProdMode } from '@angular/core';
24
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
35

src/polyfills.ts

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy