Skip to content

Commit aeda497

Browse files
committed
test(@angular/build): preserve zone change detection provider
1 parent bec2acd commit aeda497

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

tests/legacy-cli/e2e/tests/build/material.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export default async function () {
5555
// Issue: https://github.com/angular/angular-cli/issues/17320
5656
await replaceInFile(
5757
'src/app/app.config.ts',
58-
`import { ApplicationConfig } from '@angular/core';`,
58+
`from '@angular/core';`,
5959
`
60-
import { ApplicationConfig } from '@angular/core';
60+
from '@angular/core';
6161
import {
6262
MomentDateAdapter,
6363
MAT_MOMENT_DATE_FORMATS
@@ -72,10 +72,8 @@ export default async function () {
7272

7373
await replaceInFile(
7474
'src/app/app.config.ts',
75-
`providers: [provideRouter(routes) ]`,
76-
`
77-
providers: [
78-
provideRouter(routes),
75+
`provideRouter(routes)`,
76+
`provideRouter(routes),
7977
{
8078
provide: DateAdapter,
8179
useClass: MomentDateAdapter,
@@ -84,9 +82,7 @@ export default async function () {
8482
{
8583
provide: MAT_DATE_FORMATS,
8684
useValue: MAT_MOMENT_DATE_FORMATS
87-
}
88-
]
89-
`,
85+
}`,
9086
);
9187

9288
await ng('e2e', '--configuration=production');

tests/legacy-cli/e2e/tests/build/prerender/http-requests-assets.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export default async function () {
2020
await writeMultipleFiles({
2121
// Add http client and route
2222
'src/app/app.config.ts': `
23-
import { ApplicationConfig } from '@angular/core';
23+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2424
import { provideRouter } from '@angular/router';
2525
2626
import {Home} from './home/home';
@@ -35,6 +35,7 @@ export default async function () {
3535
}]),
3636
provideClientHydration(),
3737
provideHttpClient(withFetch()),
38+
provideZoneChangeDetection({ eventCoalescing: true }),
3839
],
3940
};
4041
`,

tests/legacy-cli/e2e/tests/build/server-rendering/server-routes-output-mode-static-http-calls.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default async function () {
5656
`,
5757
// Add http client and route
5858
'src/app/app.config.ts': `
59-
import { ApplicationConfig } from '@angular/core';
59+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
6060
import { provideRouter } from '@angular/router';
6161
6262
import { Home } from './home/home';
@@ -71,6 +71,7 @@ export default async function () {
7171
}]),
7272
provideClientHydration(),
7373
provideHttpClient(withFetch()),
74+
provideZoneChangeDetection({ eventCoalescing: true }),
7475
],
7576
};
7677
`,

tests/legacy-cli/e2e/tests/commands/serve/ssr-http-requests-assets.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default async function () {
2424
await writeMultipleFiles({
2525
// Add http client and route
2626
'src/app/app.config.ts': `
27-
import { ApplicationConfig } from '@angular/core';
27+
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
2828
import { provideRouter } from '@angular/router';
2929
3030
import { Home } from './home/home';
@@ -39,6 +39,7 @@ export default async function () {
3939
}]),
4040
provideClientHydration(),
4141
provideHttpClient(withFetch()),
42+
provideZoneChangeDetection({ eventCoalescing: true }),
4243
],
4344
};
4445
`,

0 commit comments

Comments
 (0)