Skip to content

Commit f530437

Browse files
committed
test(material/schematics): update integration test
The test should reflect running `ng generate` on an app that has already done `ng update` to v15 and is using legacy components.
1 parent cfc9230 commit f530437

Some content is hidden

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

49 files changed

+2928
-2139
lines changed

integration/mdc-migration/golden/.browserslistrc

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

integration/mdc-migration/golden/angular.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,7 @@
9898
}
9999
}
100100
},
101-
"defaultProject": "sample-project"
101+
"cli": {
102+
"analytics": false
103+
}
102104
}

integration/mdc-migration/golden/src/app/app.module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {MatRadioModule} from '@angular/material/radio';
2121
import {MatSelectModule} from '@angular/material/select';
2222
import {MatSlideToggleModule} from '@angular/material/slide-toggle';
2323
import {MatSliderModule} from '@angular/material/slider';
24-
import {MatSnackBarModule} from '@angular/material/legacy-snack-bar';
24+
import {MatLegacySnackBarModule as MatSnackBarModule} from '@angular/material/legacy-snack-bar';
2525
import {MatTableModule} from '@angular/material/table';
2626
import {MatTabsModule} from '@angular/material/tabs';
2727
import {MatTooltipModule} from '@angular/material/tooltip';

integration/mdc-migration/golden/src/app/components/autocomplete/autocomplete.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {ReactiveFormsModule} from '@angular/forms';
33
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
4-
import {MatAutocompleteModule} from '@angular/material/autocomplete';
4+
import {MatLegacyAutocompleteModule as MatAutocompleteModule} from '@angular/material/legacy-autocomplete';
55
import {AutocompleteComponent} from './autocomplete.component';
66

77
describe('AutocompleteComponent', () => {

integration/mdc-migration/golden/src/app/components/autocomplete/autocomplete.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, OnInit} from '@angular/core';
2-
import {FormControl} from '@angular/forms';
2+
import {UntypedFormControl} from '@angular/forms';
33
import {Observable, of} from 'rxjs';
44
import {map, startWith} from 'rxjs/operators';
55

@@ -9,7 +9,7 @@ import {map, startWith} from 'rxjs/operators';
99
styleUrls: ['./autocomplete.component.scss'],
1010
})
1111
export class AutocompleteComponent implements OnInit {
12-
myControl = new FormControl('');
12+
myControl = new UntypedFormControl('');
1313
options: string[] = ['One', 'Two', 'Three'];
1414
filteredOptions: Observable<string[]> = of([]);
1515

integration/mdc-migration/golden/src/app/components/button/button.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatButtonModule} from '@angular/material/button';
3+
import {MatLegacyButtonModule as MatButtonModule} from '@angular/material/legacy-button';
44
import {ButtonComponent} from './button.component';
55

66
describe('ButtonComponent', () => {

integration/mdc-migration/golden/src/app/components/card/card.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatCardModule} from '@angular/material/card';
3+
import {MatLegacyCardModule as MatCardModule} from '@angular/material/legacy-card';
44
import {CardComponent} from './card.component';
55

66
describe('CardComponent', () => {

integration/mdc-migration/golden/src/app/components/checkbox/checkbox.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatCheckboxModule} from '@angular/material/checkbox';
3+
import {MatLegacyCheckboxModule as MatCheckboxModule} from '@angular/material/legacy-checkbox';
44
import {CheckboxComponent} from './checkbox.component';
55

66
describe('CheckboxComponent', () => {

integration/mdc-migration/golden/src/app/components/chips/chips.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatChipsModule} from '@angular/material/chips';
4-
import {MatFormFieldModule} from '@angular/material/form-field';
3+
import {MatLegacyChipsModule as MatChipsModule} from '@angular/material/legacy-chips';
4+
import {MatLegacyFormFieldModule as MatFormFieldModule} from '@angular/material/legacy-form-field';
55
import {MatIconModule} from '@angular/material/icon';
66

77
import {ChipsComponent} from './chips.component';

integration/mdc-migration/golden/src/app/components/form-field/form-field.component.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatFormFieldModule} from '@angular/material/form-field';
4-
import {MatInputModule} from '@angular/material/input';
3+
import {MatLegacyFormFieldModule as MatFormFieldModule} from '@angular/material/legacy-form-field';
4+
import {MatLegacyInputModule as MatInputModule} from '@angular/material/legacy-input';
55
import {FormFieldComponent} from './form-field.component';
66

77
describe('FormFieldComponent', () => {

integration/mdc-migration/golden/src/app/components/input/input.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatInputModule} from '@angular/material/input';
3+
import {MatLegacyInputModule as MatInputModule} from '@angular/material/legacy-input';
44
import {InputComponent} from './input.component';
55

66
describe('InputComponent', () => {

integration/mdc-migration/golden/src/app/components/list/list.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatListModule} from '@angular/material/list';
3+
import {MatLegacyListModule as MatListModule} from '@angular/material/legacy-list';
44
import {ListComponent} from './list.component';
55

66
describe('ListComponent', () => {

integration/mdc-migration/golden/src/app/components/menu/menu.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
33
import {MatIconModule} from '@angular/material/icon';
4-
import {MatMenuModule} from '@angular/material/menu';
4+
import {MatLegacyMenuModule as MatMenuModule} from '@angular/material/legacy-menu';
55

66
import {MenuComponent} from './menu.component';
77

integration/mdc-migration/golden/src/app/components/paginator/paginator.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
2-
import {MatPaginatorModule} from '@angular/material/paginator';
2+
import {MatLegacyPaginatorModule as MatPaginatorModule} from '@angular/material/legacy-paginator';
33
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
44
import {PaginatorComponent} from './paginator.component';
55

integration/mdc-migration/golden/src/app/components/progress-bar/progress-bar.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
2-
import {MatProgressBarModule} from '@angular/material/progress-bar';
2+
import {MatLegacyProgressBarModule as MatProgressBarModule} from '@angular/material/legacy-progress-bar';
33
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
44
import {ProgressBarComponent} from './progress-bar.component';
55

integration/mdc-migration/golden/src/app/components/radio/radio.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatRadioModule} from '@angular/material/radio';
3+
import {MatLegacyRadioModule as MatRadioModule} from '@angular/material/legacy-radio';
44
import {RadioComponent} from './radio.component';
55

66
describe('RadioComponent', () => {

integration/mdc-migration/golden/src/app/components/select/select.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatSelectModule} from '@angular/material/select';
3+
import {MatLegacySelectModule as MatSelectModule} from '@angular/material/legacy-select';
44
import {SelectComponent} from './select.component';
55

66
describe('SelectComponent', () => {

integration/mdc-migration/golden/src/app/components/slider/slider.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatSliderModule} from '@angular/material/slider';
3+
import {MatLegacySliderModule as MatSliderModule} from '@angular/material/legacy-slider';
44
import {SliderComponent} from './slider.component';
55

66
describe('SliderComponent', () => {

integration/mdc-migration/golden/src/app/components/snack-bar/snack-bar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component} from '@angular/core';
2-
import {MatSnackBar} from '@angular/material/legacy-snack-bar';
2+
import {MatLegacySnackBar as MatSnackBar} from '@angular/material/legacy-snack-bar';
33

44
@Component({
55
selector: 'snack-bar-example',

integration/mdc-migration/golden/src/app/components/tooltip/tooltip.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {ComponentFixture, TestBed} from '@angular/core/testing';
22
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
3-
import {MatTooltipModule} from '@angular/material/tooltip';
3+
import {MatLegacyTooltipModule as MatTooltipModule} from '@angular/material/legacy-tooltip';
44
import {TooltipComponent} from './tooltip.component';
55

66
describe('TooltipComponent', () => {

integration/mdc-migration/golden/src/styles.scss

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
// Include the common styles for Angular Material. We include this here so that you only
88
// have to load a single css file for Angular Material in your app.
99
// Be sure that you only ever include this mixin once!
10-
@include mat.core();
10+
@include mat.all-component-typographies();
11+
@include mat.legacy-core();
1112

1213
// Define the palettes for your theme using the Material Design palettes available in palette.scss
1314
// (imported above). For each palette, you can optionally specify a default, lighter, and darker
@@ -29,51 +30,28 @@ $sample-project-theme: mat.define-light-theme((
2930
));
3031

3132
@include mat.autocomplete-theme($sample-project-theme);
32-
@include mat.autocomplete-typography($sample-project-theme);
3333
@include mat.button-theme($sample-project-theme);
34-
@include mat.button-typography($sample-project-theme);
3534
@include mat.fab-theme($sample-project-theme);
36-
@include mat.fab-typography($sample-project-theme);
3735
@include mat.icon-button-theme($sample-project-theme);
38-
@include mat.icon-button-typography($sample-project-theme);
3936
@include mat.card-theme($sample-project-theme);
40-
@include mat.card-typography($sample-project-theme);
4137
@include mat.checkbox-theme($sample-project-theme);
42-
@include mat.checkbox-typography($sample-project-theme);
4338
@include mat.chips-theme($sample-project-theme);
44-
@include mat.chips-typography($sample-project-theme);
4539
@include mat.form-field-theme($sample-project-theme);
46-
@include mat.form-field-typography($sample-project-theme);
4740
@include mat.input-theme($sample-project-theme);
48-
@include mat.input-typography($sample-project-theme);
4941
@include mat.list-theme($sample-project-theme);
50-
@include mat.list-typography($sample-project-theme);
5142
@include mat.menu-theme($sample-project-theme);
52-
@include mat.menu-typography($sample-project-theme);
5343
@include mat.paginator-theme($sample-project-theme);
54-
@include mat.paginator-typography($sample-project-theme);
44+
@include mat.select-theme($sample-project-theme);
5545
@include mat.progress-bar-theme($sample-project-theme);
56-
@include mat.progress-bar-typography($sample-project-theme);
5746
@include mat.progress-spinner-theme($sample-project-theme);
58-
@include mat.progress-spinner-typography($sample-project-theme);
5947
@include mat.radio-theme($sample-project-theme);
60-
@include mat.radio-typography($sample-project-theme);
61-
@include mat.select-theme($sample-project-theme);
62-
@include mat.select-typography($sample-project-theme);
63-
@include mat.core-theme($sample-project-theme);
64-
@include mat.core-typography($sample-project-theme);
48+
@include mat.legacy-select-theme($sample-project-theme);
6549
@include mat.slide-toggle-theme($sample-project-theme);
66-
@include mat.slide-toggle-typography($sample-project-theme);
6750
@include mat.slider-theme($sample-project-theme);
68-
@include mat.slider-typography($sample-project-theme);
6951
@include mat.snack-bar-theme($sample-project-theme);
70-
@include mat.snack-bar-typography($sample-project-theme);
7152
@include mat.table-theme($sample-project-theme);
72-
@include mat.table-typography($sample-project-theme);
7353
@include mat.tabs-theme($sample-project-theme);
74-
@include mat.tabs-typography($sample-project-theme);
7554
@include mat.tooltip-theme($sample-project-theme);
76-
@include mat.tooltip-typography($sample-project-theme);
7755

7856
/* You can add global styles to this file, and also import other style files */
7957

integration/mdc-migration/golden/src/test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,5 @@ import {
77
platformBrowserDynamicTesting,
88
} from '@angular/platform-browser-dynamic/testing';
99

10-
declare const require: {
11-
context(
12-
path: string,
13-
deep?: boolean,
14-
filter?: RegExp,
15-
): {
16-
keys(): string[];
17-
<T>(id: string): T;
18-
};
19-
};
20-
2110
// First, initialize the Angular testing environment.
2211
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
23-
24-
// Then we find all the tests.
25-
const context = require.context('./', true, /\.spec\.ts$/);
26-
// And load the modules.
27-
context.keys().map(context);

integration/mdc-migration/golden/tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
"experimentalDecorators": true,
1717
"moduleResolution": "node",
1818
"importHelpers": true,
19-
"target": "es2017",
19+
"target": "ES2022",
2020
"module": "es2020",
21-
"lib": ["es2018", "dom"]
21+
"lib": ["es2018", "dom"],
22+
"useDefineForClassFields": false
2223
},
2324
"angularCompilerOptions": {
2425
"enableI18nLegacyMessageIdFormat": false,

integration/mdc-migration/sample-project/.browserslistrc

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

integration/mdc-migration/sample-project/angular.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,7 @@
9898
}
9999
}
100100
},
101-
"defaultProject": "sample-project"
101+
"cli": {
102+
"analytics": false
103+
}
102104
}

integration/mdc-migration/sample-project/package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,24 @@
1010
},
1111
"private": true,
1212
"dependencies": {
13-
"@angular/animations": "^13.1.3",
14-
"@angular/cdk": "^13.1.3",
15-
"@angular/common": "^13.1.3",
16-
"@angular/compiler": "^13.1.3",
17-
"@angular/core": "^13.1.3",
18-
"@angular/forms": "^13.1.3",
19-
"@angular/material": "^13.1.3",
20-
"@angular/platform-browser": "^13.1.3",
21-
"@angular/platform-browser-dynamic": "^13.1.3",
22-
"@angular/router": "^13.1.3",
13+
"@angular/animations": "^15.0.0-next.4",
14+
"@angular/cdk": "^15.0.0-next.3",
15+
"@angular/common": "^15.0.0-next.4",
16+
"@angular/compiler": "^15.0.0-next.4",
17+
"@angular/core": "^15.0.0-next.4",
18+
"@angular/forms": "^15.0.0-next.4",
19+
"@angular/material": "^15.0.0-next.3",
20+
"@angular/platform-browser": "^15.0.0-next.4",
21+
"@angular/platform-browser-dynamic": "^15.0.0-next.4",
22+
"@angular/router": "^15.0.0-next.4",
2323
"rxjs": "^6.5.3",
2424
"tslib": "^2.3.0",
2525
"zone.js": "~0.11.4"
2626
},
2727
"devDependencies": {
28-
"@angular-devkit/build-angular": "^13.1.4",
29-
"@angular/cli": "^13.1.4",
30-
"@angular/compiler-cli": "^13.1.3",
28+
"@angular-devkit/build-angular": "^15.0.0-next.3",
29+
"@angular/cli": "^15.0.0-next.3",
30+
"@angular/compiler-cli": "^15.0.0-next.4",
3131
"@types/jasmine": "~3.9.0",
3232
"@types/node": "^12.11.1",
3333
"glob": "^7.2.0",
@@ -37,6 +37,6 @@
3737
"karma-coverage": "~2.0.3",
3838
"karma-jasmine": "~4.0.0",
3939
"karma-jasmine-html-reporter": "~1.7.0",
40-
"typescript": "~4.4.2"
40+
"typescript": "~4.8.4"
4141
}
4242
}

0 commit comments

Comments
 (0)