Skip to content

Commit 8a96385

Browse files
committed
fixup! test(multiple): Update test initializer to provide zoneless by default
1 parent 73f6c16 commit 8a96385

File tree

97 files changed

+273
-359
lines changed

Some content is hidden

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

97 files changed

+273
-359
lines changed

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@
5656
},
5757
"version": "18.1.0-next.0",
5858
"dependencies": {
59-
"@angular/animations": "^18.0.0-rc.1",
60-
"@angular/common": "^18.0.0-rc.1",
61-
"@angular/compiler": "^18.0.0-rc.1",
62-
"@angular/core": "^18.0.0-rc.1",
63-
"@angular/forms": "^18.0.0-rc.1",
64-
"@angular/platform-browser": "^18.0.0-rc.1",
59+
"@angular/animations": "^18.0.0-rc.2",
60+
"@angular/common": "^18.0.0-rc.2",
61+
"@angular/compiler": "^18.0.0-rc.2",
62+
"@angular/core": "^18.0.0-rc.2",
63+
"@angular/forms": "^18.0.0-rc.2",
64+
"@angular/platform-browser": "^18.0.0-rc.2",
6565
"@types/google.maps": "^3.54.10",
6666
"@types/youtube": "^0.0.50",
6767
"rxjs": "^6.6.7",
@@ -76,12 +76,12 @@
7676
"@angular/bazel": "https://github.com/angular/bazel-builds.git#bac9c1abe1e6ac1801fbbccb53353a1ed7126469",
7777
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#a11e93b01708684827af3873e9232b437c209237",
7878
"@angular/cli": "^18.0.0-rc.0",
79-
"@angular/compiler-cli": "^18.0.0-rc.1",
80-
"@angular/localize": "^18.0.0-rc.1",
79+
"@angular/compiler-cli": "^18.0.0-rc.2",
80+
"@angular/localize": "^18.0.0-rc.2",
8181
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#36946be4df61f6549ae3829c026022e47674eae2",
82-
"@angular/platform-browser-dynamic": "^18.0.0-rc.1",
83-
"@angular/platform-server": "^18.0.0-rc.1",
84-
"@angular/router": "^18.0.0-rc.1",
82+
"@angular/platform-browser-dynamic": "^18.0.0-rc.2",
83+
"@angular/platform-server": "^18.0.0-rc.2",
84+
"@angular/router": "^18.0.0-rc.2",
8585
"@babel/core": "^7.16.12",
8686
"@babel/helper-explode-assignable-expression": "^7.18.6",
8787
"@babel/helper-string-parser": "^7.22.5",

src/cdk-experimental/combobox/combobox.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import {
22
Component,
3-
ɵZONELESS_ENABLED,
43
DebugElement,
54
ElementRef,
65
ViewChild,
6+
provideZoneChangeDetection,
77
signal,
88
} from '@angular/core';
99
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
@@ -32,7 +32,7 @@ describe('Combobox', () => {
3232

3333
beforeEach(waitForAsync(() => {
3434
TestBed.configureTestingModule({
35-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
35+
providers: [provideZoneChangeDetection()],
3636
imports: [CdkComboboxModule, ComboboxToggle],
3737
}).compileComponents();
3838
}));

src/cdk-experimental/popover-edit/popover-edit.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77
Component,
88
Directive,
99
ElementRef,
10-
ɵZONELESS_ENABLED,
1110
ViewChild,
1211
provideZoneChangeDetection,
1312
} from '@angular/core';
@@ -389,7 +388,7 @@ describe('CDK Popover Edit', () => {
389388
beforeEach(fakeAsync(() => {
390389
TestBed.configureTestingModule({
391390
imports: [CdkTableModule, CdkPopoverEditModule, CommonModule, FormsModule, BidiModule],
392-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}, provideZoneChangeDetection()],
391+
providers: [provideZoneChangeDetection()],
393392
declarations: [componentClass],
394393
}).compileComponents();
395394
fixture = TestBed.createComponent<BaseTestComponent>(componentClass);

src/cdk-experimental/table-scroll-container/table-scroll-container.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {CollectionViewer, DataSource} from '@angular/cdk/collections';
2-
import {Component, Type, ViewChild, ɵZONELESS_ENABLED} from '@angular/core';
2+
import {Component, Type, ViewChild, provideZoneChangeDetection} from '@angular/core';
33
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
44
import {BehaviorSubject, combineLatest} from 'rxjs';
55
import {map} from 'rxjs/operators';
@@ -23,7 +23,7 @@ describe('CdkTableScrollContainer', () => {
2323
declarations: any[] = [],
2424
): ComponentFixture<T> {
2525
TestBed.configureTestingModule({
26-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
26+
providers: [provideZoneChangeDetection()],
2727
imports: [CdkTableModule, CdkTableScrollContainerModule, componentType, ...declarations],
2828
}).compileComponents();
2929

src/cdk/a11y/focus-monitor/focus-monitor.spec.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,7 @@ import {
88
dispatchEvent,
99
} from '../../testing/private';
1010
import {DOCUMENT} from '@angular/common';
11-
import {
12-
Component,
13-
NgZone,
14-
ViewChild,
15-
provideZoneChangeDetection,
16-
ɵZONELESS_ENABLED,
17-
} from '@angular/core';
11+
import {Component, NgZone, ViewChild, provideZoneChangeDetection} from '@angular/core';
1812
import {ComponentFixture, fakeAsync, flush, inject, TestBed, tick} from '@angular/core/testing';
1913
import {By} from '@angular/platform-browser';
2014
import {Platform} from '@angular/cdk/platform';
@@ -832,11 +826,7 @@ describe('FocusMonitor observable stream', () => {
832826
fakePlatform = {isBrowser: true} as Platform;
833827
TestBed.configureTestingModule({
834828
imports: [A11yModule, PlainButton],
835-
providers: [
836-
{provide: Platform, useValue: fakePlatform},
837-
{provide: ɵZONELESS_ENABLED, useValue: false},
838-
provideZoneChangeDetection(),
839-
],
829+
providers: [{provide: Platform, useValue: fakePlatform}, provideZoneChangeDetection()],
840830
}).compileComponents();
841831
});
842832

src/cdk/a11y/focus-trap/focus-trap.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
TemplateRef,
66
ViewContainerRef,
77
ViewEncapsulation,
8-
ɵZONELESS_ENABLED,
8+
provideZoneChangeDetection,
99
} from '@angular/core';
1010
import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
1111
import {PortalModule, CdkPortalOutlet, TemplatePortal} from '@angular/cdk/portal';
@@ -15,7 +15,7 @@ import {By} from '@angular/platform-browser';
1515
describe('FocusTrap', () => {
1616
beforeEach(waitForAsync(() => {
1717
TestBed.configureTestingModule({
18-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
18+
providers: [provideZoneChangeDetection()],
1919
imports: [
2020
A11yModule,
2121
PortalModule,

src/cdk/a11y/live-announcer/live-announcer.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {MutationObserverFactory} from '@angular/cdk/observers';
22
import {Overlay} from '@angular/cdk/overlay';
33
import {ComponentPortal} from '@angular/cdk/portal';
4-
import {Component, ɵZONELESS_ENABLED} from '@angular/core';
4+
import {Component, provideZoneChangeDetection} from '@angular/core';
55
import {ComponentFixture, fakeAsync, flush, inject, TestBed, tick} from '@angular/core/testing';
66
import {By} from '@angular/platform-browser';
77
import {A11yModule} from '../index';
@@ -21,7 +21,7 @@ describe('LiveAnnouncer', () => {
2121
describe('with default element', () => {
2222
beforeEach(() =>
2323
TestBed.configureTestingModule({
24-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
24+
providers: [provideZoneChangeDetection()],
2525
imports: [A11yModule, TestApp, TestModal],
2626
}),
2727
);
@@ -128,7 +128,7 @@ describe('LiveAnnouncer', () => {
128128
fixture.destroy();
129129

130130
TestBed.resetTestingModule().configureTestingModule({
131-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
131+
providers: [provideZoneChangeDetection()],
132132
imports: [A11yModule],
133133
});
134134

@@ -228,7 +228,7 @@ describe('LiveAnnouncer', () => {
228228
return TestBed.configureTestingModule({
229229
imports: [A11yModule, TestApp],
230230
providers: [
231-
{provide: ɵZONELESS_ENABLED, useValue: false},
231+
provideZoneChangeDetection(),
232232
{provide: LIVE_ANNOUNCER_ELEMENT_TOKEN, useValue: customLiveElement},
233233
],
234234
});
@@ -254,7 +254,7 @@ describe('LiveAnnouncer', () => {
254254
return TestBed.configureTestingModule({
255255
imports: [A11yModule, TestApp],
256256
providers: [
257-
{provide: ɵZONELESS_ENABLED, useValue: false},
257+
provideZoneChangeDetection(),
258258
{
259259
provide: LIVE_ANNOUNCER_DEFAULT_OPTIONS,
260260
useValue: {
@@ -303,7 +303,7 @@ describe('CdkAriaLive', () => {
303303
TestBed.configureTestingModule({
304304
imports: [A11yModule, DivWithCdkAriaLive],
305305
providers: [
306-
{provide: ɵZONELESS_ENABLED, useValue: false},
306+
provideZoneChangeDetection(),
307307
{
308308
provide: MutationObserverFactory,
309309
useValue: {

src/cdk/clipboard/copy-to-clipboard.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, ɵZONELESS_ENABLED} from '@angular/core';
1+
import {Component, provideZoneChangeDetection} from '@angular/core';
22
import {ComponentFixture, fakeAsync, TestBed, tick} from '@angular/core/testing';
33

44
import {Clipboard} from './clipboard';
@@ -30,7 +30,7 @@ describe('CdkCopyToClipboard', () => {
3030
beforeEach(fakeAsync(() => {
3131
TestBed.configureTestingModule({
3232
imports: [ClipboardModule, CopyToClipboardHost],
33-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
33+
providers: [provideZoneChangeDetection()],
3434
});
3535

3636
TestBed.compileComponents();

src/cdk/drag-drop/directives/drag.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
ViewChildren,
2323
ViewEncapsulation,
2424
provideZoneChangeDetection,
25-
ɵZONELESS_ENABLED,
2625
} from '@angular/core';
2726
import {TestBed, ComponentFixture, fakeAsync, flush, tick} from '@angular/core/testing';
2827
import {ViewportRuler, CdkScrollableModule} from '@angular/cdk/scrolling';
@@ -55,7 +54,6 @@ describe('CdkDrag', () => {
5554
TestBed.configureTestingModule({
5655
imports: [DragDropModule, CdkScrollableModule],
5756
providers: [
58-
{provide: ɵZONELESS_ENABLED, useValue: false},
5957
provideZoneChangeDetection(),
6058
{
6159
provide: CDK_DRAG_CONFIG,

src/cdk/drag-drop/drag-drop.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, ElementRef, ɵZONELESS_ENABLED} from '@angular/core';
1+
import {Component, ElementRef, provideZoneChangeDetection} from '@angular/core';
22
import {fakeAsync, TestBed, inject} from '@angular/core/testing';
33
import {DragDropModule} from './drag-drop-module';
44
import {DragDrop} from './drag-drop';
@@ -10,7 +10,7 @@ describe('DragDrop', () => {
1010

1111
beforeEach(fakeAsync(() => {
1212
TestBed.configureTestingModule({
13-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
13+
providers: [provideZoneChangeDetection()],
1414
imports: [DragDropModule, TestComponent],
1515
});
1616

src/cdk/listbox/listbox.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {fakeAsync, TestBed, tick} from '@angular/core/testing';
2-
import {Component, signal, Type, ɵZONELESS_ENABLED} from '@angular/core';
2+
import {Component, signal, Type, provideZoneChangeDetection} from '@angular/core';
33
import {By} from '@angular/platform-browser';
44
import {CdkListbox, CdkListboxModule, CdkOption, ListboxValueChangeEvent} from './index';
55
import {dispatchFakeEvent, dispatchKeyboardEvent, dispatchMouseEvent} from '../testing/private';
@@ -21,7 +21,7 @@ function setupComponent<T, O = string>(component: Type<T>, imports: any[] = [])
2121
TestBed.configureTestingModule({
2222
imports: [CdkListboxModule, ...imports],
2323
declarations: [component],
24-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
24+
providers: [provideZoneChangeDetection()],
2525
}).compileComponents();
2626
const fixture = TestBed.createComponent(component);
2727
fixture.detectChanges();

src/cdk/menu/context-menu-trigger.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
Type,
66
ViewChildren,
77
QueryList,
8-
ɵZONELESS_ENABLED,
8+
provideZoneChangeDetection,
99
} from '@angular/core';
1010
import {CdkMenuModule} from './menu-module';
1111
import {TestBed, waitForAsync, ComponentFixture} from '@angular/core/testing';
@@ -26,7 +26,7 @@ describe('CdkContextMenuTrigger', () => {
2626
TestBed.configureTestingModule({
2727
imports: [CdkMenuModule],
2828
declarations: [SimpleContextMenu],
29-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
29+
providers: [provideZoneChangeDetection()],
3030
}).compileComponents();
3131
}));
3232

@@ -160,7 +160,7 @@ describe('CdkContextMenuTrigger', () => {
160160
beforeEach(waitForAsync(() => {
161161
TestBed.configureTestingModule({
162162
imports: [CdkMenuModule],
163-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
163+
providers: [provideZoneChangeDetection()],
164164
declarations: [NestedContextMenu],
165165
}).compileComponents();
166166
}));
@@ -410,7 +410,7 @@ describe('CdkContextMenuTrigger', () => {
410410
function createComponent<T>(componentClass: Type<T>) {
411411
TestBed.configureTestingModule({
412412
imports: [CdkMenuModule],
413-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
413+
providers: [provideZoneChangeDetection()],
414414
declarations: [componentClass],
415415
}).compileComponents();
416416

src/cdk/menu/menu-item-checkbox.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, ElementRef, ɵZONELESS_ENABLED} from '@angular/core';
1+
import {Component, ElementRef, provideZoneChangeDetection} from '@angular/core';
22
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
33
import {By} from '@angular/platform-browser';
44
import {CdkMenuModule} from './menu-module';
@@ -16,7 +16,7 @@ describe('MenuItemCheckbox', () => {
1616
TestBed.configureTestingModule({
1717
imports: [CdkMenuModule, SingleCheckboxButton],
1818
providers: [
19-
{provide: ɵZONELESS_ENABLED, useValue: false},
19+
provideZoneChangeDetection(),
2020
{provide: CDK_MENU, useClass: CdkMenu},
2121
{provide: MENU_STACK, useClass: MenuStack},
2222
// View engine can't figure out the ElementRef to inject so we need to provide a fake

src/cdk/menu/menu-item-radio.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, ElementRef, ɵZONELESS_ENABLED} from '@angular/core';
1+
import {Component, ElementRef, provideZoneChangeDetection} from '@angular/core';
22
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
33
import {By} from '@angular/platform-browser';
44
import {UniqueSelectionDispatcher} from '@angular/cdk/collections';
@@ -19,7 +19,7 @@ describe('MenuItemRadio', () => {
1919
TestBed.configureTestingModule({
2020
imports: [CdkMenuModule, SimpleRadioButton],
2121
providers: [
22-
{provide: ɵZONELESS_ENABLED, useValue: false},
22+
provideZoneChangeDetection(),
2323
{provide: UniqueSelectionDispatcher, useValue: selectionDispatcher},
2424
{provide: CDK_MENU, useClass: CdkMenu},
2525
{provide: MENU_STACK, useClass: MenuStack},

src/cdk/menu/menu-item.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, Type, ElementRef, ɵZONELESS_ENABLED} from '@angular/core';
1+
import {Component, Type, ElementRef, provideZoneChangeDetection} from '@angular/core';
22
import {ComponentFixture, TestBed, waitForAsync} from '@angular/core/testing';
33
import {dispatchKeyboardEvent} from '@angular/cdk/testing/private';
44
import {By} from '@angular/platform-browser';
@@ -20,7 +20,7 @@ describe('MenuItem', () => {
2020
imports: [CdkMenuModule],
2121
declarations: [SingleMenuItem],
2222
providers: [
23-
{provide: ɵZONELESS_ENABLED, useValue: false},
23+
provideZoneChangeDetection(),
2424
{provide: CDK_MENU, useClass: CdkMenu},
2525
{provide: MENU_STACK, useClass: MenuStack},
2626
// View engine can't figure out the ElementRef to inject so we need to provide a fake
@@ -83,7 +83,7 @@ describe('MenuItem', () => {
8383
TestBed.configureTestingModule({
8484
imports: [CdkMenuModule, MatIcon],
8585
providers: [
86-
{provide: ɵZONELESS_ENABLED, useValue: false},
86+
provideZoneChangeDetection(),
8787
{provide: CDK_MENU, useClass: CdkMenu},
8888
{provide: MENU_STACK, useClass: MenuStack},
8989
// View engine can't figure out the ElementRef to inject so we need to provide a fake

src/cdk/menu/menu-trigger.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
ElementRef,
66
ViewChild,
77
Type,
8-
ɵZONELESS_ENABLED,
8+
provideZoneChangeDetection,
99
} from '@angular/core';
1010
import {ComponentFixture, TestBed, fakeAsync, tick, waitForAsync} from '@angular/core/testing';
1111
import {By} from '@angular/platform-browser';
@@ -27,7 +27,7 @@ describe('MenuTrigger', () => {
2727
TestBed.configureTestingModule({
2828
imports: [CdkMenuModule],
2929
declarations: [TriggerForEmptyMenu],
30-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
30+
providers: [provideZoneChangeDetection()],
3131
}).compileComponents();
3232
}));
3333

src/cdk/menu/pointer-focus-tracker.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
ElementRef,
55
ViewChildren,
66
AfterViewInit,
7-
ɵZONELESS_ENABLED,
7+
provideZoneChangeDetection,
88
} from '@angular/core';
99
import {waitForAsync, ComponentFixture, TestBed} from '@angular/core/testing';
1010
import {createMouseEvent, dispatchEvent} from '../../cdk/testing/private';
@@ -26,7 +26,7 @@ describe('FocusMouseManger', () => {
2626

2727
beforeEach(waitForAsync(() => {
2828
TestBed.configureTestingModule({
29-
providers: [{provide: ɵZONELESS_ENABLED, useValue: false}],
29+
providers: [provideZoneChangeDetection()],
3030
imports: [MultiElementWithConditionalComponent, MockWrapper],
3131
}).compileComponents();
3232
}));

0 commit comments

Comments
 (0)