Skip to content

Commit e91ceaf

Browse files
mmalerbajelbourn
authored andcommitted
chore(e2e): break up E2eMaterialModules (#15633)
This change brings the e2e app more inline with the dev-app by removing the "MaterialModules" anti-pattern. This will allow us to add lazy loading to the e2e app in a future PR.
1 parent 2a8a57d commit e91ceaf

Some content is hidden

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

43 files changed

+763
-157
lines changed

.github/CODEOWNERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,26 @@
176176
/src/e2e-app/* @jelbourn
177177
/src/e2e-app/block-scroll-strategy/** @andrewseguin @crisbeto
178178
/src/e2e-app/button/** @jelbourn
179+
/src/e2e-app/button-toggle/** @jelbourn
180+
/src/e2e-app/card/** @jelbourn
179181
/src/e2e-app/checkbox/** @jelbourn @devversion
180182
/src/e2e-app/dialog/** @jelbourn @crisbeto
181183
/src/e2e-app/e2e-app/** @jelbourn
184+
/src/e2e-app/example-viewer/** @andrewseguin
185+
/src/e2e-app/expansion/** @josephperrott
182186
/src/e2e-app/grid-list/** @jelbourn
183187
/src/e2e-app/icon/** @jelbourn
184188
/src/e2e-app/input/** @mmalerba
189+
/src/e2e-app/list/** @jelbourn
185190
/src/e2e-app/menu/** @crisbeto
186191
/src/e2e-app/progress-bar/** @jelbourn @crisbeto @josephperrott
187192
/src/e2e-app/progress-spinner/** @jelbourn @crisbeto @josephperrott
188193
/src/e2e-app/radio/** @jelbourn @devversion
189194
/src/e2e-app/sidenav/** @mmalerba
190195
/src/e2e-app/slide-toggle/** @devversion
196+
/src/e2e-app/stepper/** @mmalerba
191197
/src/e2e-app/tabs/** @andrewseguin
198+
/src/e2e-app/toolbar/** @devversion
192199
/src/e2e-app/virtual-scroll/** @mmalerba
193200

194201
# Universal app

packages.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ ANGULAR_LIBRARY_UMDS = [
123123
"@npm//node_modules/@angular/compiler:bundles/compiler.umd.js",
124124
"@npm//node_modules/@angular/core:bundles/core-testing.umd.js",
125125
"@npm//node_modules/@angular/core:bundles/core.umd.js",
126+
"@npm//node_modules/@angular/elements:bundles/elements.umd.js",
126127
"@npm//node_modules/@angular/forms:bundles/forms.umd.js",
127128
"@npm//node_modules/@angular/platform-browser-dynamic:bundles/platform-browser-dynamic-testing.umd.js",
128129
"@npm//node_modules/@angular/platform-browser-dynamic:bundles/platform-browser-dynamic.umd.js",

src/e2e-app/BUILD.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ ng_module(
1010
assets = glob(["**/*.html", "**/*.css"], exclude = ["index.html"]),
1111
deps = [
1212
"@npm//@angular/core",
13+
"@npm//@angular/elements",
1314
"@npm//@angular/forms",
1415
"@npm//@angular/platform-browser",
1516
"@npm//@angular/router",
1617
"@npm//@angular/animations",
18+
"@npm//@webcomponents/custom-elements",
1719
"//src/cdk/drag-drop",
1820
"//src/cdk/overlay",
1921
"//src/cdk/scrolling",
@@ -43,6 +45,7 @@ ts_devserver(
4345
"@npm//zone.js",
4446
"@npm//core-js",
4547
"@npm//hammerjs",
48+
"@npm//@webcomponents/custom-elements",
4649
"//src/lib/prebuilt-themes:indigo-pink",
4750
":index.html",
4851
],
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {ScrollingModule} from '@angular/cdk/scrolling';
10+
import {NgModule} from '@angular/core';
11+
import {BlockScrollStrategyE2E} from './block-scroll-strategy-e2e';
12+
13+
@NgModule({
14+
imports: [ScrollingModule],
15+
declarations: [BlockScrollStrategyE2E],
16+
})
17+
export class BlockScrollStrategyE2eModule {
18+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {NgModule} from '@angular/core';
10+
import {ExampleViewerModule} from '../example-viewer/example-viewer-module';
11+
import {ButtonToggleE2e} from './button-toggle-e2e';
12+
13+
@NgModule({
14+
imports: [
15+
ExampleViewerModule,
16+
],
17+
declarations: [ButtonToggleE2e],
18+
})
19+
export class ButtonToggleE2eModule {
20+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Component} from '@angular/core';
10+
11+
@Component({
12+
moduleId: module.id,
13+
selector: 'button-toggle-demo',
14+
template: `<example-list-viewer [ids]="examples"></example-list-viewer>`,
15+
})
16+
export class ButtonToggleE2e {
17+
examples = ['button-toggle-overview'];
18+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {NgModule} from '@angular/core';
10+
import {MatButtonModule, MatIconModule} from '@angular/material';
11+
import {ButtonE2E} from './button-e2e';
12+
13+
@NgModule({
14+
imports: [
15+
MatButtonModule,
16+
MatIconModule,
17+
],
18+
declarations: [ButtonE2E],
19+
})
20+
export class ButtonE2eModule {
21+
}

src/e2e-app/card/card-e2e-module.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {NgModule} from '@angular/core';
10+
import {ExampleViewerModule} from '../example-viewer/example-viewer-module';
11+
import {CardE2e} from './card-e2e';
12+
13+
@NgModule({
14+
imports: [
15+
ExampleViewerModule,
16+
],
17+
declarations: [CardE2e],
18+
})
19+
export class CardE2eModule {
20+
}

src/e2e-app/card/card-e2e.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Component} from '@angular/core';
10+
11+
@Component({
12+
moduleId: module.id,
13+
selector: 'card-demo',
14+
template: `<example-list-viewer [ids]="examples"></example-list-viewer>`,
15+
})
16+
export class CardE2e {
17+
examples = ['card-fancy'];
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {NgModule} from '@angular/core';
10+
import {MatCheckboxModule} from '@angular/material';
11+
import {SimpleCheckboxes} from './checkbox-e2e';
12+
13+
@NgModule({
14+
imports: [MatCheckboxModule],
15+
declarations: [SimpleCheckboxes],
16+
})
17+
export class CheckboxE2eModule {
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {NgModule} from '@angular/core';
10+
import {MatDialogModule} from '@angular/material';
11+
import {DialogE2E, TestDialog} from './dialog-e2e';
12+
13+
@NgModule({
14+
imports: [MatDialogModule],
15+
declarations: [DialogE2E, TestDialog],
16+
entryComponents: [TestDialog]
17+
})
18+
export class DialogE2eModule {
19+
}

src/e2e-app/e2e-app-module.ts

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

src/e2e-app/e2e-app.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* @license
3+
* Copyright Google LLC All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Component, ViewEncapsulation} from '@angular/core';
10+
11+
/** Root component for the e2e-app demos. */
12+
@Component({
13+
moduleId: module.id,
14+
selector: 'e2e-app',
15+
template: '<e2e-app-layout><router-outlet></router-outlet></e2e-app-layout>',
16+
encapsulation: ViewEncapsulation.None,
17+
})
18+
export class E2eApp {
19+
}

src/e2e-app/e2e-app/e2e-app.html renamed to src/e2e-app/e2e-app/e2e-app-layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
</mat-nav-list>
2626

2727
<main>
28-
<router-outlet></router-outlet>
28+
<ng-content></ng-content>
2929
</main>

src/e2e-app/e2e-app/e2e-app-layout.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import {Component, ViewEncapsulation} from '@angular/core';
2+
3+
4+
@Component({selector: 'home', template: `<p>e2e website!</p>`})
5+
export class Home {
6+
}
7+
8+
@Component({
9+
moduleId: module.id,
10+
selector: 'e2e-app-layout',
11+
templateUrl: 'e2e-app-layout.html',
12+
encapsulation: ViewEncapsulation.None,
13+
})
14+
export class E2eAppLayout {
15+
showLinks: boolean = false;
16+
}

0 commit comments

Comments
 (0)