Skip to content

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

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

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
@atscott atscott requested review from mmalerba and crisbeto as code owners May 16, 2024 18:26
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 force-pushed the zonelesstestsmore branch from 0f8524d to 3cf2cb9 Compare May 16, 2024 18:27
@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)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
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.

3 participants