Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(menu): remove provideZoneChangeDetection for all menu tests #29061

Merged
merged 1 commit into from
May 21, 2024

Conversation

atscott
Copy link
Contributor

@atscott atscott commented May 16, 2024

This removes 'provideZoneChangeDetection' from menu tests. Change summary:

  • Many tests set inputs directly. This isn't really how it happens in applications - inputs set from the template automatically mark components for check. When tests set inputs directly like this, they need to call markForCheck manually (or something similar).
  • One test seems to be calling a public API (CdkContextMenuTrigger.open) that failed to call markForCheck so that was added to the implementation
  • fakeAsync had an additional timer so I just added flush to make it work.

@atscott atscott added the target: rc This PR is targeted for the next release-candidate label May 16, 2024
This removes 'provideZoneChangeDetection' from menu tests. Change summary:

* Many tests set inputs directly. This isn't really how it happens in
  applications - inputs set from the template automatically mark
  components for check. When tests set inputs directly like this, they
  need to call `markForCheck` manually (or something similar).
* Similarly, test components need to be marked for check when setting
  values
* One test seems to be calling a public API (`CdkContextMenuTrigger.open`)
  that failed to call `markForCheck` so that was added to the implementation
* `fakeAsync` had an additional timer so I just added `flush` to make it
  work.
@atscott atscott added the action: merge The PR is ready for merge by the caretaker label May 16, 2024
@mmalerba mmalerba merged commit 325533a into angular:main May 21, 2024
24 of 26 checks passed
mmalerba pushed a commit that referenced this pull request May 21, 2024
…29061)

This removes 'provideZoneChangeDetection' from menu tests. Change summary:

* Many tests set inputs directly. This isn't really how it happens in
  applications - inputs set from the template automatically mark
  components for check. When tests set inputs directly like this, they
  need to call `markForCheck` manually (or something similar).
* Similarly, test components need to be marked for check when setting
  values
* One test seems to be calling a public API (`CdkContextMenuTrigger.open`)
  that failed to call `markForCheck` so that was added to the implementation
* `fakeAsync` had an additional timer so I just added `flush` to make it
  work.

(cherry picked from commit 325533a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker target: rc This PR is targeted for the next release-candidate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants