Skip to content

Commit 467b489

Browse files
author
Michael Seemann
committed
update @angular 14
1 parent 796b0ef commit 467b489

Some content is hidden

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

46 files changed

+3349
-4023
lines changed

angular.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,6 @@
340340
}
341341
}
342342
},
343-
"defaultProject": "demo",
344343
"schematics": {
345344
"@schematics/angular:component": {
346345
"style": "scss"

package.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,32 @@
5353
},
5454
"private": true,
5555
"dependencies": {
56-
"@angular/animations": "13.0.2",
57-
"@angular/common": "13.0.2",
58-
"@angular/compiler": "13.0.2",
59-
"@angular/core": "13.0.2",
60-
"@angular/forms": "13.0.2",
61-
"@angular/platform-browser": "13.0.2",
62-
"@angular/platform-browser-dynamic": "13.0.2",
63-
"@angular/router": "13.0.2",
56+
"@angular/animations": "14.0.0",
57+
"@angular/common": "14.0.0",
58+
"@angular/compiler": "14.0.0",
59+
"@angular/core": "14.0.0",
60+
"@angular/forms": "14.0.0",
61+
"@angular/platform-browser": "14.0.0",
62+
"@angular/platform-browser-dynamic": "14.0.0",
63+
"@angular/router": "14.0.0",
6464
"match-sorter": "4.1.0",
6565
"moment": "^2.18.1",
6666
"rxjs": "~6.5.3",
6767
"tslib": "^2.3.1",
6868
"zone.js": "~0.11.4"
6969
},
7070
"devDependencies": {
71-
"@angular-devkit/architect": "0.1300.3",
72-
"@angular-devkit/build-angular": "~13.0.3",
73-
"@angular-devkit/core": "^13.0.3",
71+
"@angular-devkit/architect": "0.1400.0",
72+
"@angular-devkit/build-angular": "^14.0.0",
73+
"@angular-devkit/core": "^14.0.0",
7474
"@angular-eslint/builder": "^13.2.1",
7575
"@angular-eslint/eslint-plugin": "^13.2.1",
7676
"@angular-eslint/eslint-plugin-template": "^13.2.1",
7777
"@angular-eslint/schematics": "^13.2.1",
7878
"@angular-eslint/template-parser": "^13.2.1",
79-
"@angular/cli": "13.0.3",
80-
"@angular/compiler-cli": "13.0.2",
81-
"@angular/language-service": "13.0.2",
79+
"@angular/cli": "14.0.0",
80+
"@angular/compiler-cli": "14.0.0",
81+
"@angular/language-service": "14.0.0",
8282
"@types/jasmine": "~3.6.0",
8383
"@types/jasminewd2": "~2.0.3",
8484
"@types/node": "^14.0.0",
@@ -101,13 +101,13 @@
101101
"karma-jasmine-html-reporter": "^1.5.0",
102102
"material-design-lite": "1.3.0",
103103
"ncp": "2.0.0",
104-
"ng-packagr": "^13.0.5",
104+
"ng-packagr": "^14.0.0",
105105
"prettier": "^2.5.1",
106106
"pretty-quick": "^3.1.0",
107107
"protractor": "~7.0.0",
108108
"rimraf": "3.0.2",
109109
"ts-node": "~8.9.0",
110-
"typescript": "~4.4.4"
110+
"typescript": "~4.7.3"
111111
},
112112
"husky": {
113113
"hooks": {

projects/core/src/lib/checkbox/mdl-checkbox.component.spec.ts

Lines changed: 51 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ class MdlTestCheckboxComponent {
2828
}
2929

3030
describe("Component: MdlCheckbox", () => {
31-
beforeEach(
32-
waitForAsync(() => {
33-
TestBed.configureTestingModule({
34-
imports: [MdlCheckboxModule.forRoot(), FormsModule],
35-
declarations: [MdlTestCheckboxComponent],
36-
});
37-
})
38-
);
31+
beforeEach(waitForAsync(() => {
32+
TestBed.configureTestingModule({
33+
imports: [MdlCheckboxModule.forRoot(), FormsModule],
34+
declarations: [MdlTestCheckboxComponent],
35+
});
36+
}));
3937

4038
it("should add the css class mdl-checkbox to the host element", () => {
4139
const fixture = TestBed.createComponent(MdlTestCheckboxComponent);
@@ -45,29 +43,26 @@ describe("Component: MdlCheckbox", () => {
4543
expect(checkboxEl.classList.contains("mdl-checkbox")).toBe(true);
4644
});
4745

48-
it(
49-
"should support ngModel",
50-
waitForAsync(() => {
51-
const fixture = TestBed.createComponent(MdlTestCheckboxComponent);
52-
fixture.detectChanges();
53-
fixture.whenStable().then(() => {
54-
const testInstance = fixture.componentInstance;
46+
it("should support ngModel", waitForAsync(() => {
47+
const fixture = TestBed.createComponent(MdlTestCheckboxComponent);
48+
fixture.detectChanges();
49+
fixture.whenStable().then(() => {
50+
const testInstance = fixture.componentInstance;
5551

56-
// let el = <HTMLInputElement> fixture.debugElement.query(By.css('input')).nativeElement;
57-
const checkboxComponent = fixture.debugElement.query(
58-
By.directive(MdlCheckboxComponent)
59-
).componentInstance;
52+
// let el = <HTMLInputElement> fixture.debugElement.query(By.css('input')).nativeElement;
53+
const checkboxComponent = fixture.debugElement.query(
54+
By.directive(MdlCheckboxComponent)
55+
).componentInstance;
6056

61-
testInstance.checkboxValue1 = true;
57+
testInstance.checkboxValue1 = true;
6258

63-
fixture.detectChanges();
64-
fixture.whenStable().then(() => {
65-
// but el.checked is not true ?
66-
expect(checkboxComponent.value).toEqual(true);
67-
});
59+
fixture.detectChanges();
60+
fixture.whenStable().then(() => {
61+
// but el.checked is not true ?
62+
expect(checkboxComponent.value).toEqual(true);
6863
});
69-
})
70-
);
64+
});
65+
}));
7166

7267
it("should change the value on click", () => {
7368
const fixture = TestBed.createComponent(MdlTestCheckboxComponent);
@@ -112,49 +107,43 @@ describe("Component: MdlCheckbox", () => {
112107
expect(checkboxEl.classList.contains("is-focused")).toBe(false);
113108
});
114109

115-
it(
116-
"should fire a change event if the state changed",
117-
waitForAsync(() => {
118-
const fixture = TestBed.createComponent(MdlTestCheckboxComponent);
119-
fixture.detectChanges();
110+
it("should fire a change event if the state changed", waitForAsync(() => {
111+
const fixture = TestBed.createComponent(MdlTestCheckboxComponent);
112+
fixture.detectChanges();
120113

121-
const instance = fixture.componentInstance;
114+
const instance = fixture.componentInstance;
122115

123-
spyOn(instance, "onChange");
116+
spyOn(instance, "onChange");
124117

125-
fixture.debugElement
126-
.query(By.directive(MdlCheckboxComponent))
127-
.nativeElement.click();
118+
fixture.debugElement
119+
.query(By.directive(MdlCheckboxComponent))
120+
.nativeElement.click();
128121

129-
expect(instance.onChange).toHaveBeenCalledWith(true);
130-
})
131-
);
122+
expect(instance.onChange).toHaveBeenCalledWith(true);
123+
}));
132124

133-
it(
134-
"should be possible to disable the checkbox",
135-
waitForAsync(() => {
136-
const fixture = TestBed.createComponent(MdlTestCheckboxComponent);
137-
fixture.detectChanges();
125+
it("should be possible to disable the checkbox", waitForAsync(() => {
126+
const fixture = TestBed.createComponent(MdlTestCheckboxComponent);
127+
fixture.detectChanges();
138128

139-
const instance = fixture.componentInstance;
140-
const cbDebugElem = fixture.debugElement.query(
141-
By.directive(MdlCheckboxComponent)
142-
);
129+
const instance = fixture.componentInstance;
130+
const cbDebugElem = fixture.debugElement.query(
131+
By.directive(MdlCheckboxComponent)
132+
);
143133

144-
cbDebugElem.componentInstance.setDisabledState(true);
145-
fixture.detectChanges();
134+
cbDebugElem.componentInstance.setDisabledState(true);
135+
fixture.detectChanges();
136+
137+
const checkboxEl: HTMLElement = cbDebugElem.nativeElement;
138+
expect(checkboxEl.classList.contains("is-disabled")).toBe(
139+
true,
140+
"should have css is-disabled"
141+
);
146142

147-
const checkboxEl: HTMLElement = cbDebugElem.nativeElement;
148-
expect(checkboxEl.classList.contains("is-disabled")).toBe(
149-
true,
150-
"should have css is-disabled"
151-
);
152-
153-
// should not change on click
154-
cbDebugElem.nativeElement.click();
155-
expect(instance.checkboxValue1).toEqual(false);
156-
})
157-
);
143+
// should not change on click
144+
cbDebugElem.nativeElement.click();
145+
expect(instance.checkboxValue1).toEqual(false);
146+
}));
158147

159148
it("should be possible to set a tabindex", () => {
160149
TestBed.overrideComponent(MdlTestCheckboxComponent, {

projects/core/src/lib/dialog-outlet/mdl-dialog-outlet.component.spec.ts

Lines changed: 25 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,34 +25,28 @@ describe("MdlDialogOutletComponent", () => {
2525
let el: HTMLElement | undefined;
2626

2727
// create the tesbed
28-
beforeEach(
29-
waitForAsync(() => {
30-
TestBed.configureTestingModule({
31-
declarations: [],
32-
imports: [MdlDialogOutletModule.forRoot()],
33-
});
34-
})
35-
);
28+
beforeEach(waitForAsync(() => {
29+
TestBed.configureTestingModule({
30+
declarations: [],
31+
imports: [MdlDialogOutletModule.forRoot()],
32+
});
33+
}));
3634

3735
// now modify the dom and add a dialog-outlet element direct under the body
38-
beforeEach(
39-
waitForAsync(
40-
inject([DOCUMENT], (doc: Document) => {
41-
el = doc.createElement("dialog-outlet");
42-
doc.body.appendChild(el);
43-
})
44-
)
45-
);
36+
beforeEach(waitForAsync(
37+
inject([DOCUMENT], (doc: Document) => {
38+
el = doc.createElement("dialog-outlet");
39+
doc.body.appendChild(el);
40+
})
41+
));
4642

47-
afterEach(
48-
waitForAsync(
49-
inject([DOCUMENT], (doc: Document) => {
50-
if (el) {
51-
doc.body.removeChild(el);
52-
}
53-
})
54-
)
55-
);
43+
afterEach(waitForAsync(
44+
inject([DOCUMENT], (doc: Document) => {
45+
if (el) {
46+
doc.body.removeChild(el);
47+
}
48+
})
49+
));
5650

5751
// now we can boostrap our MdlDialogOutletComponent component
5852
it("should create the dialog-outlet outside the app-root", async () => {
@@ -67,14 +61,12 @@ describe("MdlDialogOutletComponent", () => {
6761
});
6862

6963
describe("MdlDialogInnerOutletComponent", () => {
70-
beforeEach(
71-
waitForAsync(() => {
72-
TestBed.configureTestingModule({
73-
declarations: [],
74-
imports: [TestDialogModul],
75-
});
76-
})
77-
);
64+
beforeEach(waitForAsync(() => {
65+
TestBed.configureTestingModule({
66+
declarations: [],
67+
imports: [TestDialogModul],
68+
});
69+
}));
7870

7971
it("should create the dialog-outlet if within the app-root", () => {
8072
const fixture = TestBed.createComponent(MdlTestViewComponent);

projects/core/src/lib/dialog-outlet/mdl-dialog-outlet.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const PRIVATE_COMPONENTS = [
2020
imports: [],
2121
exports: PUBLIC_COMPONENTS,
2222
declarations: [...PUBLIC_COMPONENTS, ...PRIVATE_COMPONENTS],
23-
entryComponents: [MdlDialogOutletComponent, MdlBackdropOverlayComponent],
2423
})
2524
export class MdlDialogOutletModule {
2625
public static forRoot(): ModuleWithProviders<MdlDialogOutletModule> {

projects/core/src/lib/dialog/mdl-alert.component.spec.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ class MdlTestComponent {
2525
}
2626

2727
describe("MdlAlert", () => {
28-
beforeEach(
29-
waitForAsync(() => {
30-
TestBed.configureTestingModule({
31-
imports: [MdlDialogModule.forRoot(), MdlDialogOutletModule],
32-
declarations: [MdlTestComponent],
33-
});
34-
})
35-
);
28+
beforeEach(waitForAsync(() => {
29+
TestBed.configureTestingModule({
30+
imports: [MdlDialogModule.forRoot(), MdlDialogOutletModule],
31+
declarations: [MdlTestComponent],
32+
});
33+
}));
3634

3735
it("should create, show and close the dialog", async () => {
3836
const fixture = TestBed.createComponent(MdlTestComponent);

projects/core/src/lib/dialog/mdl-dialog.component.spec.ts

Lines changed: 28 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -77,39 +77,34 @@ class ModalComponent {
7777
}
7878

7979
describe("MdlDialog (embedded/declarative)", () => {
80-
beforeEach(
81-
waitForAsync(() => {
82-
TestBed.configureTestingModule({
83-
imports: [MdlDialogModule.forRoot(), MdlDialogOutletModule],
84-
declarations: [
85-
MdlTestComponent,
86-
ModalTrueConfigFalseComponent,
87-
ModalFalseConfigTrueComponent,
88-
ModalComponent,
89-
],
90-
});
91-
})
92-
);
93-
94-
it(
95-
"should create, show and close the embedded dialog",
96-
waitForAsync(() => {
97-
const fixture = TestBed.createComponent(MdlTestComponent);
98-
fixture.detectChanges();
99-
const dialog = fixture.componentInstance.dialog;
100-
expect(dialog).toBeDefined("mdldialog should be created");
101-
102-
spyOn(fixture.componentInstance, "onDialogShow").and.callThrough();
103-
spyOn(fixture.componentInstance, "onDialogHide");
104-
105-
dialog?.show().subscribe(() => {
106-
dialog.close();
107-
108-
expect(fixture.componentInstance.onDialogShow).toHaveBeenCalled();
109-
expect(fixture.componentInstance.onDialogHide).toHaveBeenCalled();
110-
});
111-
})
112-
);
80+
beforeEach(waitForAsync(() => {
81+
TestBed.configureTestingModule({
82+
imports: [MdlDialogModule.forRoot(), MdlDialogOutletModule],
83+
declarations: [
84+
MdlTestComponent,
85+
ModalTrueConfigFalseComponent,
86+
ModalFalseConfigTrueComponent,
87+
ModalComponent,
88+
],
89+
});
90+
}));
91+
92+
it("should create, show and close the embedded dialog", waitForAsync(() => {
93+
const fixture = TestBed.createComponent(MdlTestComponent);
94+
fixture.detectChanges();
95+
const dialog = fixture.componentInstance.dialog;
96+
expect(dialog).toBeDefined("mdldialog should be created");
97+
98+
spyOn(fixture.componentInstance, "onDialogShow").and.callThrough();
99+
spyOn(fixture.componentInstance, "onDialogHide");
100+
101+
dialog?.show().subscribe(() => {
102+
dialog.close();
103+
104+
expect(fixture.componentInstance.onDialogShow).toHaveBeenCalled();
105+
expect(fixture.componentInstance.onDialogHide).toHaveBeenCalled();
106+
});
107+
}));
113108

114109
it("should not be possible to create a second embedded dialog", () => {
115110
const fixture = TestBed.createComponent(MdlTestComponent);

projects/core/src/lib/dialog/mdl-dialog.module.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const PRIVATE_COMPONENTS = [MdlDialogHostComponent, MdlSimpleDialogComponent];
3333
],
3434
exports: [...PUBLIC_COMPONENTS],
3535
declarations: [...PUBLIC_COMPONENTS, ...PRIVATE_COMPONENTS],
36-
entryComponents: [...PUBLIC_COMPONENTS, ...PRIVATE_COMPONENTS],
3736
})
3837
export class MdlDialogModule {
3938
public static forRoot(): ModuleWithProviders<MdlDialogModule> {

0 commit comments

Comments
 (0)