diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 9a91efe1262a..093e4974d285 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -243,34 +243,12 @@ # E2E app /src/e2e-app/* @andrewseguin -/src/e2e-app/block-scroll-strategy/** @andrewseguin @crisbeto -/src/e2e-app/button-toggle/** @andrewseguin -/src/e2e-app/card/** @andrewseguin -/src/e2e-app/component-harness/** @mmalerba -/src/e2e-app/e2e-app/** @andrewseguin -/src/e2e-app/example-viewer/** @andrewseguin -/src/e2e-app/expansion/** @andrewseguin -/src/e2e-app/grid-list/** @andrewseguin -/src/e2e-app/icon/** @andrewseguin -/src/e2e-app/list/** @andrewseguin -/src/e2e-app/button/** @andrewseguin -/src/e2e-app/checkbox/** @mmalerba -/src/e2e-app/dialog/** @devversion -/src/e2e-app/input/** @devversion -/src/e2e-app/menu/** @crisbeto -/src/e2e-app/progress-bar/** @crisbeto -/src/e2e-app/progress-spinner/** @mmalerba -/src/e2e-app/radio/** @mmalerba -/src/e2e-app/slide-toggle/** @crisbeto -/src/e2e-app/slider/** @andrewseguin -/src/e2e-app/table/** @andrewseguin -/src/e2e-app/tabs/** @crisbeto -/src/e2e-app/select/** @crisbeto -/src/e2e-app/sidenav/** @mmalerba -/src/e2e-app/stepper/** @mmalerba -/src/e2e-app/test-util/** @andrewseguin -/src/e2e-app/toolbar/** @devversion -/src/e2e-app/virtual-scroll/** @mmalerba +/src/e2e-app/components/home.ts @andrewseguin +/src/e2e-app/components/block-scroll-strategy/** @andrewseguin @crisbeto +/src/e2e-app/components/component-harness-e2e.ts @mmalerba +/src/e2e-app/components/e2e-app/** @andrewseguin +/src/e2e-app/components/slider-e2e.ts @andrewseguin +/src/e2e-app/components/virtual-scroll/** @mmalerba # Universal app /src/universal-app/** @devversion diff --git a/src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e-module.ts b/src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e-module.ts deleted file mode 100644 index fdcfef823668..000000000000 --- a/src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e-module.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {ScrollingModule} from '@angular/cdk/scrolling'; -import {NgModule} from '@angular/core'; -import {BlockScrollStrategyE2E} from './block-scroll-strategy-e2e'; - -@NgModule({ - imports: [ScrollingModule], - declarations: [BlockScrollStrategyE2E], -}) -export class BlockScrollStrategyE2eModule {} diff --git a/src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e.ts b/src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e.ts deleted file mode 100644 index 2f0121bdf2a6..000000000000 --- a/src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e.ts +++ /dev/null @@ -1,12 +0,0 @@ -import {Component} from '@angular/core'; -import {Overlay, ScrollStrategy} from '@angular/cdk/overlay'; - -@Component({ - selector: 'block-scroll-strategy-e2e', - templateUrl: 'block-scroll-strategy-e2e.html', - styleUrls: ['block-scroll-strategy-e2e.css'], -}) -export class BlockScrollStrategyE2E { - constructor(private _overlay: Overlay) {} - scrollStrategy: ScrollStrategy = this._overlay.scrollStrategies.block(); -} diff --git a/src/e2e-app/component-harness/component-harness-e2e-module.ts b/src/e2e-app/component-harness/component-harness-e2e-module.ts deleted file mode 100644 index 572392c85ba3..000000000000 --- a/src/e2e-app/component-harness/component-harness-e2e-module.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ -import {TestComponentsModule} from '../../cdk/testing/tests'; -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {FormsModule} from '@angular/forms'; -import {ComponentHarnessE2e} from './component-harness-e2e'; - -@NgModule({ - imports: [CommonModule, FormsModule, TestComponentsModule], - declarations: [ComponentHarnessE2e], -}) -export class ComponentHarnessE2eModule {} diff --git a/src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e.css b/src/e2e-app/components/block-scroll-strategy/block-scroll-strategy-e2e.css similarity index 100% rename from src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e.css rename to src/e2e-app/components/block-scroll-strategy/block-scroll-strategy-e2e.css diff --git a/src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e.html b/src/e2e-app/components/block-scroll-strategy/block-scroll-strategy-e2e.html similarity index 100% rename from src/e2e-app/block-scroll-strategy/block-scroll-strategy-e2e.html rename to src/e2e-app/components/block-scroll-strategy/block-scroll-strategy-e2e.html diff --git a/src/e2e-app/components/block-scroll-strategy/block-scroll-strategy-e2e.ts b/src/e2e-app/components/block-scroll-strategy/block-scroll-strategy-e2e.ts new file mode 100644 index 000000000000..ae9914514d4f --- /dev/null +++ b/src/e2e-app/components/block-scroll-strategy/block-scroll-strategy-e2e.ts @@ -0,0 +1,14 @@ +import {Component, inject} from '@angular/core'; +import {Overlay} from '@angular/cdk/overlay'; +import {ScrollingModule} from '@angular/cdk/scrolling'; + +@Component({ + selector: 'block-scroll-strategy-e2e', + templateUrl: 'block-scroll-strategy-e2e.html', + styleUrls: ['block-scroll-strategy-e2e.css'], + standalone: true, + imports: [ScrollingModule], +}) +export class BlockScrollStrategyE2E { + scrollStrategy = inject(Overlay).scrollStrategies.block(); +} diff --git a/src/e2e-app/component-harness/component-harness-e2e.ts b/src/e2e-app/components/component-harness-e2e.ts similarity index 71% rename from src/e2e-app/component-harness/component-harness-e2e.ts rename to src/e2e-app/components/component-harness-e2e.ts index 78aa04b03df3..1320be8ccd78 100644 --- a/src/e2e-app/component-harness/component-harness-e2e.ts +++ b/src/e2e-app/components/component-harness-e2e.ts @@ -1,9 +1,12 @@ import {ChangeDetectionStrategy, Component, ViewEncapsulation} from '@angular/core'; +import {TestComponentsModule} from '@angular/cdk/testing/tests'; @Component({ selector: 'component-harness-e2e', template: ``, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [TestComponentsModule], }) export class ComponentHarnessE2e {} diff --git a/src/e2e-app/e2e-app/e2e-app-layout.html b/src/e2e-app/components/e2e-app/e2e-app.html similarity index 88% rename from src/e2e-app/e2e-app/e2e-app-layout.html rename to src/e2e-app/components/e2e-app/e2e-app.html index 21f924e9199e..d948ef73a18f 100644 --- a/src/e2e-app/e2e-app/e2e-app-layout.html +++ b/src/e2e-app/components/e2e-app/e2e-app.html @@ -5,5 +5,5 @@ {{link.title}} - + diff --git a/src/e2e-app/e2e-app/e2e-app-layout.ts b/src/e2e-app/components/e2e-app/e2e-app.ts similarity index 54% rename from src/e2e-app/e2e-app/e2e-app-layout.ts rename to src/e2e-app/components/e2e-app/e2e-app.ts index e3ce0f8370b5..a53e5714d254 100644 --- a/src/e2e-app/e2e-app/e2e-app-layout.ts +++ b/src/e2e-app/components/e2e-app/e2e-app.ts @@ -1,14 +1,16 @@ import {Component, ViewEncapsulation} from '@angular/core'; - -@Component({selector: 'home', template: `

e2e website!

`}) -export class Home {} +import {NgFor, NgIf} from '@angular/common'; +import {MatListModule} from '@angular/material/list'; +import {RouterLink, RouterOutlet} from '@angular/router'; @Component({ - selector: 'e2e-app-layout', - templateUrl: 'e2e-app-layout.html', + selector: 'e2e-app', + templateUrl: 'e2e-app.html', encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [MatListModule, NgIf, NgFor, RouterLink, RouterOutlet], }) -export class E2eAppLayout { +export class E2eApp { showLinks = false; navLinks = [ diff --git a/src/e2e-app/components/home.ts b/src/e2e-app/components/home.ts new file mode 100644 index 000000000000..ce44f0c3162b --- /dev/null +++ b/src/e2e-app/components/home.ts @@ -0,0 +1,8 @@ +import {Component} from '@angular/core'; + +@Component({ + selector: 'home', + template: `

Welcome to the e2e tests app

`, + standalone: true, +}) +export class Home {} diff --git a/src/e2e-app/slider/slider-e2e.ts b/src/e2e-app/components/slider-e2e.ts similarity index 88% rename from src/e2e-app/slider/slider-e2e.ts rename to src/e2e-app/components/slider-e2e.ts index 660913592367..ed7e7aa49606 100644 --- a/src/e2e-app/slider/slider-e2e.ts +++ b/src/e2e-app/components/slider-e2e.ts @@ -7,6 +7,7 @@ */ import {Component} from '@angular/core'; +import {MatSliderModule} from '@angular/material/slider'; @Component({ selector: 'slider-e2e', @@ -25,5 +26,7 @@ import {Component} from '@angular/core'; `, styles: ['.mat-mdc-slider { width: 148px; }'], + standalone: true, + imports: [MatSliderModule], }) export class SliderE2e {} diff --git a/src/e2e-app/virtual-scroll/virtual-scroll-e2e.css b/src/e2e-app/components/virtual-scroll/virtual-scroll-e2e.css similarity index 100% rename from src/e2e-app/virtual-scroll/virtual-scroll-e2e.css rename to src/e2e-app/components/virtual-scroll/virtual-scroll-e2e.css diff --git a/src/e2e-app/virtual-scroll/virtual-scroll-e2e.html b/src/e2e-app/components/virtual-scroll/virtual-scroll-e2e.html similarity index 100% rename from src/e2e-app/virtual-scroll/virtual-scroll-e2e.html rename to src/e2e-app/components/virtual-scroll/virtual-scroll-e2e.html diff --git a/src/e2e-app/virtual-scroll/virtual-scroll-e2e.ts b/src/e2e-app/components/virtual-scroll/virtual-scroll-e2e.ts similarity index 63% rename from src/e2e-app/virtual-scroll/virtual-scroll-e2e.ts rename to src/e2e-app/components/virtual-scroll/virtual-scroll-e2e.ts index c91443dd88bb..d810adbee5cf 100644 --- a/src/e2e-app/virtual-scroll/virtual-scroll-e2e.ts +++ b/src/e2e-app/components/virtual-scroll/virtual-scroll-e2e.ts @@ -1,4 +1,6 @@ import {Component} from '@angular/core'; +import {ScrollingModule} from '@angular/cdk/scrolling'; +import {ScrollingModule as ExperimentalScrollingModule} from '@angular/cdk-experimental/scrolling'; const itemSizeSample = [100, 25, 50, 50, 100, 200, 75, 100, 50, 250]; @@ -6,6 +8,8 @@ const itemSizeSample = [100, 25, 50, 50, 100, 200, 75, 100, 50, 250]; selector: 'virtual-scroll-e2e', templateUrl: 'virtual-scroll-e2e.html', styleUrls: ['virtual-scroll-e2e.css'], + standalone: true, + imports: [ScrollingModule, ExperimentalScrollingModule], }) export class VirtualScrollE2E { uniformItems = Array(1000).fill(50); diff --git a/src/e2e-app/e2e-app.ts b/src/e2e-app/e2e-app.ts deleted file mode 100644 index 0bd04a2847a9..000000000000 --- a/src/e2e-app/e2e-app.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {Component, ViewEncapsulation} from '@angular/core'; - -/** Root component for the e2e-app demos. */ -@Component({ - selector: 'e2e-app', - template: '', - encapsulation: ViewEncapsulation.None, -}) -export class E2eApp {} diff --git a/src/e2e-app/e2e-app/e2e-app-module.ts b/src/e2e-app/e2e-app/e2e-app-module.ts deleted file mode 100644 index 807c74be264a..000000000000 --- a/src/e2e-app/e2e-app/e2e-app-module.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {CommonModule} from '@angular/common'; -import {NgModule} from '@angular/core'; -import {MatListModule} from '@angular/material/list'; -import {RouterModule} from '@angular/router'; -import {E2eAppLayout, Home} from './e2e-app-layout'; - -@NgModule({ - imports: [CommonModule, MatListModule, RouterModule], - declarations: [E2eAppLayout, Home], - exports: [E2eAppLayout], -}) -export class E2eAppModule {} diff --git a/src/e2e-app/favicon.ico b/src/e2e-app/favicon.ico deleted file mode 100644 index 8081c7ceaf2b..000000000000 Binary files a/src/e2e-app/favicon.ico and /dev/null differ diff --git a/src/e2e-app/index.html b/src/e2e-app/index.html index 80258fa1f0a4..54cffdde4b48 100644 --- a/src/e2e-app/index.html +++ b/src/e2e-app/index.html @@ -6,14 +6,10 @@ Angular Material - - - - Loading... diff --git a/src/e2e-app/main-module.ts b/src/e2e-app/main-module.ts deleted file mode 100644 index 354386337a44..000000000000 --- a/src/e2e-app/main-module.ts +++ /dev/null @@ -1,30 +0,0 @@ -import {NgModule} from '@angular/core'; -import {BrowserModule} from '@angular/platform-browser'; -import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; -import {RouterModule} from '@angular/router'; -import {BlockScrollStrategyE2eModule} from './block-scroll-strategy/block-scroll-strategy-e2e-module'; -import {ComponentHarnessE2eModule} from './component-harness/component-harness-e2e-module'; -import {E2eApp} from './e2e-app'; -import {E2eAppModule} from './e2e-app/e2e-app-module'; -import {E2E_APP_ROUTES} from './routes'; -import {VirtualScrollE2eModule} from './virtual-scroll/virtual-scroll-e2e-module'; - -/** We allow for animations to be explicitly enabled in certain e2e tests. */ -const enableAnimations = window.location.search.includes('animations=true'); - -@NgModule({ - imports: [ - BrowserModule, - E2eAppModule, - BrowserAnimationsModule.withConfig({disableAnimations: !enableAnimations}), - RouterModule.forRoot(E2E_APP_ROUTES), - - // E2E demos - BlockScrollStrategyE2eModule, - ComponentHarnessE2eModule, - VirtualScrollE2eModule, - ], - declarations: [E2eApp], - bootstrap: [E2eApp], -}) -export class MainModule {} diff --git a/src/e2e-app/main.ts b/src/e2e-app/main.ts index 44c9253d5715..1b9cdad7bb59 100644 --- a/src/e2e-app/main.ts +++ b/src/e2e-app/main.ts @@ -1,8 +1,27 @@ import {enableProdMode} from '@angular/core'; -import {platformBrowser} from '@angular/platform-browser'; +import {bootstrapApplication, provideProtractorTestingSupport} from '@angular/platform-browser'; +import {provideNoopAnimations} from '@angular/platform-browser/animations'; +import {provideRouter} from '@angular/router'; -import {MainModule} from './main-module'; +import {E2eApp} from './components/e2e-app/e2e-app'; +import {Home} from './components/home'; +import {BlockScrollStrategyE2E} from './components/block-scroll-strategy/block-scroll-strategy-e2e'; +import {ComponentHarnessE2e} from './components/component-harness-e2e'; +import {SliderE2e} from './components/slider-e2e'; +import {VirtualScrollE2E} from './components/virtual-scroll/virtual-scroll-e2e'; enableProdMode(); -platformBrowser().bootstrapModule(MainModule); +bootstrapApplication(E2eApp, { + providers: [ + provideNoopAnimations(), + provideProtractorTestingSupport(), + provideRouter([ + {path: '', component: Home}, + {path: 'block-scroll-strategy', component: BlockScrollStrategyE2E}, + {path: 'component-harness', component: ComponentHarnessE2e}, + {path: 'slider', component: SliderE2e}, + {path: 'virtual-scroll', component: VirtualScrollE2E}, + ]), + ], +}); diff --git a/src/e2e-app/routes.ts b/src/e2e-app/routes.ts deleted file mode 100644 index 923d0797dbf8..000000000000 --- a/src/e2e-app/routes.ts +++ /dev/null @@ -1,14 +0,0 @@ -import {Routes} from '@angular/router'; -import {BlockScrollStrategyE2E} from './block-scroll-strategy/block-scroll-strategy-e2e'; -import {ComponentHarnessE2e} from './component-harness/component-harness-e2e'; -import {Home} from './e2e-app/e2e-app-layout'; -import {SliderE2e} from './slider/slider-e2e'; -import {VirtualScrollE2E} from './virtual-scroll/virtual-scroll-e2e'; - -export const E2E_APP_ROUTES: Routes = [ - {path: '', component: Home}, - {path: 'block-scroll-strategy', component: BlockScrollStrategyE2E}, - {path: 'component-harness', component: ComponentHarnessE2e}, - {path: 'slider', component: SliderE2e}, - {path: 'virtual-scroll', component: VirtualScrollE2E}, -]; diff --git a/src/e2e-app/slider/slider-e2e-module.ts b/src/e2e-app/slider/slider-e2e-module.ts deleted file mode 100644 index 27ebab5b634e..000000000000 --- a/src/e2e-app/slider/slider-e2e-module.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {NgModule} from '@angular/core'; -import {MatSliderModule} from '@angular/material/slider'; -import {SliderE2e} from './slider-e2e'; - -@NgModule({ - imports: [MatSliderModule], - declarations: [SliderE2e], -}) -export class SliderE2eModule {} diff --git a/src/e2e-app/virtual-scroll/virtual-scroll-e2e-module.ts b/src/e2e-app/virtual-scroll/virtual-scroll-e2e-module.ts deleted file mode 100644 index 9415221c759f..000000000000 --- a/src/e2e-app/virtual-scroll/virtual-scroll-e2e-module.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright Google LLC All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {ScrollingModule as ExperimentalScrollingModule} from '@angular/cdk-experimental/scrolling'; -import {ScrollingModule} from '@angular/cdk/scrolling'; -import {NgModule} from '@angular/core'; -import {VirtualScrollE2E} from './virtual-scroll-e2e'; - -@NgModule({ - imports: [ScrollingModule, ExperimentalScrollingModule], - declarations: [VirtualScrollE2E], -}) -export class VirtualScrollE2eModule {}