From c235ecef8a21b373b7975f240483912781095b34 Mon Sep 17 00:00:00 2001 From: SkyZeroZx <73321943+SkyZeroZx@users.noreply.github.com> Date: Sat, 5 Sep 2026 12:58:23 -0500 Subject: [PATCH] test(forms): remove redundant change detection configuration OnPush is now the default change detection strategy, and tests run zoneless by default, so the explicit configuration is no longer needed. --- .../forms/signals/test/node/form_root.spec.ts | 8 +------- .../forms/signals/test/web/compat_form.spec.ts | 8 +------- .../web/debounce_async_validation_bug.spec.ts | 3 +-- .../forms/signals/test/web/field_proxy.spec.ts | 16 +--------------- packages/forms/signals/test/web/interop.spec.ts | 7 ------- .../test/web/signal_form_control_web.spec.ts | 9 +-------- packages/forms/test/ng_control_status_spec.ts | 7 +------ .../test/value_accessor_integration_spec.ts | 1 - 8 files changed, 6 insertions(+), 53 deletions(-) diff --git a/packages/forms/signals/test/node/form_root.spec.ts b/packages/forms/signals/test/node/form_root.spec.ts index cfda352a7b6..466b03fb47b 100644 --- a/packages/forms/signals/test/node/form_root.spec.ts +++ b/packages/forms/signals/test/node/form_root.spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import {Component, provideZonelessChangeDetection, signal} from '@angular/core'; +import {Component, signal} from '@angular/core'; import {TestBed} from '@angular/core/testing'; import {FormsModule, ReactiveFormsModule} from '@angular/forms'; @@ -33,12 +33,6 @@ class TestCmp { } describe('FormRoot', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [provideZonelessChangeDetection()], - }); - }); - it('should set novalidate on the form element', () => { const fixture = act(() => TestBed.createComponent(TestCmp)); const formElement = fixture.nativeElement.querySelector('form') as HTMLFormElement; diff --git a/packages/forms/signals/test/web/compat_form.spec.ts b/packages/forms/signals/test/web/compat_form.spec.ts index 6a86fdcaf9f..fee30feedc4 100644 --- a/packages/forms/signals/test/web/compat_form.spec.ts +++ b/packages/forms/signals/test/web/compat_form.spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import {Component, provideZonelessChangeDetection, signal} from '@angular/core'; +import {Component, signal} from '@angular/core'; import {TestBed} from '@angular/core/testing'; import {FormControl} from '@angular/forms'; import {compatForm} from '../../compat'; @@ -14,12 +14,6 @@ import {FormField} from '../../public_api'; import {act} from '@angular/private/testing'; describe('compatForm with [formField] directive', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [provideZonelessChangeDetection()], - }); - }); - it('should bind compat form to input with [formField] directive', () => { @Component({ imports: [FormField], diff --git a/packages/forms/signals/test/web/debounce_async_validation_bug.spec.ts b/packages/forms/signals/test/web/debounce_async_validation_bug.spec.ts index c1d115ce505..34425bbffef 100644 --- a/packages/forms/signals/test/web/debounce_async_validation_bug.spec.ts +++ b/packages/forms/signals/test/web/debounce_async_validation_bug.spec.ts @@ -6,7 +6,7 @@ * found in the LICENSE file at https://angular.dev/license */ -import {ChangeDetectionStrategy, Component, debounced, resource, signal} from '@angular/core'; +import {Component, debounced, resource, signal} from '@angular/core'; import {TestBed} from '@angular/core/testing'; import {form, FormField, validateAsync} from '../../public_api'; @@ -15,7 +15,6 @@ describe('debounced inside validateAsync bug', () => { it('should not throw a cycle error when using debounced in validateAsync factory', async () => { @Component({ selector: 'debounce-bug', - changeDetection: ChangeDetectionStrategy.OnPush, template: ` `, imports: [FormField], }) diff --git a/packages/forms/signals/test/web/field_proxy.spec.ts b/packages/forms/signals/test/web/field_proxy.spec.ts index 7274f952028..e5c0bbd86de 100644 --- a/packages/forms/signals/test/web/field_proxy.spec.ts +++ b/packages/forms/signals/test/web/field_proxy.spec.ts @@ -6,31 +6,18 @@ * found in the LICENSE file at https://angular.dev/license */ -import { - ChangeDetectionStrategy, - Component, - input, - provideZonelessChangeDetection, - signal, -} from '@angular/core'; +import {Component, input, signal} from '@angular/core'; import {TestBed} from '@angular/core/testing'; import {form, type FieldTree} from '../../public_api'; import {act} from '@angular/private/testing'; describe('field proxy', () => { - beforeEach(() => { - TestBed.configureTestingModule({ - providers: [provideZonelessChangeDetection()], - }); - }); - it('@for over array field should be reactive', () => { @Component({ selector: 'iterate-field', template: `@for (i of f(); track i) {
hi
}`, - changeDetection: ChangeDetectionStrategy.OnPush, }) class IterateFieldCmp { f = input.required