Skip to content

refactor(forms): modernize value accessor integration tests - #71140

Open
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:forms/modernize-value-accessor-tests
Open

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:forms/modernize-value-accessor-tests

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Migrate the value accessor integration spec to current Angular patterns:

  • use standalone fixtures that import only the forms module they need, instead of declaring them through an initTest helper
  • replace *ngFor/*ngIf with @for/@if
  • use inject() instead of constructor injection

The reactive and template integration specs reuse two of these fixtures and are updated to create them directly.

Migrate the value accessor integration spec to current Angular patterns:
- use standalone fixtures that import only the forms module they need,
  instead of declaring them through an `initTest` helper
- replace `*ngFor`/`*ngIf` with `@for`/`@if`
- use `inject()` instead of constructor injection

The reactive and template integration specs reuse two of these fixtures and
are updated to create them directly.
@pullapprove
pullapprove Bot requested a review from JeanMeche October 2, 2026 15:37
@ngbot ngbot Bot added this to the Backlog milestone Oct 2, 2026

it('should disable a custom control if disabled attr is added', async () => {
const fixture = initTest(NgModelCustomWrapper, NgModelCustomComp);
const fixture = TestBed.createComponent(NgModelCustomWrapper);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks sus, the component is not standalone

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NgModelCustomWrapper isn鈥檛 defined in this file; it鈥檚 imported from value_accessor_integration_spec.ts. This PR makes it standalone there by having it import FormsModule and NgModelCustomComp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants