bug(mat-form-field): Async validators can't be tested with MatFormFieldHarness
- Langage dominant
- TypeScript
- Étoiles
- 25k
- Forks
- 6.8k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 91
Description
### Is this a regression?
- [ ] Yes, this behavior used to work in the previous version
### The previous version in which this bug was not present was
_No response_
### Description
When I try to test an async validator in a mat-form-file, the error never shows up and my test fails.
### Reproduction
[StackBlitz link](https://stackblitz.com/edit/2ptgpt)
Steps to reproduce:
1. Run the test.
### Expected Behavior
It should succeed by calling `tick(1)`
### Actual Behavior
I have to call `MatInput#ngDoCheck` or `MatInput#updateErrorState` manually, and it really feels weird.
### Environment
Angular CLI: 18.0.2
Node: 18.20.3
Package Manager: yarn 1.22.19
OS: linux x64
Angular: 18.0.1
... animations, common, compiler, compiler-cli, core, forms
... localize, platform-browser, platform-browser-dynamic, router
Package Version
------------------------------------------------------------
@angular-devkit/architect 0.1800.2
@angular-devkit/build-angular 18.0.2
@angular-devkit/core 18.0.2
@angular-devkit/schematics 18.0.2
@angular/cdk 18.1.4
@angular/cli 18.0.2
@angular/material 18.1.4
@angular/material-experimental 18.1.4
@angular/material-moment-adapter 18.1.4
@schematics/angular 18.0.2
rxjs 7.4.0
typescript 5.4.5
zone.js 0.14.6
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par exécuter la reproduction StackBlitz liée et par lire le comportement de MatFormFieldHarness autour des validateurs asynchrones. Comparez le déroulement du test avec les appels MatInput#ngDoCheck ou MatInput#updateErrorState invoqués manuellement. C'est terminé lorsque le test réussit avec tick(1) seul et que l'erreur de validation asynchrone apparaît.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- angular, typescript
- Domaine
- frontend, testing
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100