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

Update Deprecated waitForNextUpdate Hook to waitFor #198186

Closed
6 tasks
opauloh opened this issue Oct 29, 2024 · 2 comments
Closed
6 tasks

Update Deprecated waitForNextUpdate Hook to waitFor #198186

opauloh opened this issue Oct 29, 2024 · 2 comments
Assignees
Labels

Comments

@opauloh
Copy link
Contributor

opauloh commented Oct 29, 2024

Motivation

The waitForNextUpdate hook in Testing Library is deprecated and will be removed in future versions. To ensure our tests remain compatible with upcoming versions and avoid potential failures, we need to replace instances of waitForNextUpdate with waitFor. This update will improve the maintainability and future-proofing of our test suite.

Fixing those will also help with the #195087, where some tests are falling due to the missing await.

Definition of done

  • Identify all instances where waitForNextUpdate is used in the cloud_security_posture plugin's test code.
  • - [ ] Identify all instances where waitForNextUpdate is used in the Agentless scope of fleet plugin's test code.
  • Replace waitForNextUpdate with waitFor in each identified instance, ensuring that the tests still perform as expected.
  • Validate that the updated tests pass and behave consistently with the original waitForNextUpdate implementation.
  • Document any changes made and include notes on the new waitFor approach, if necessary.
  • Submit a PR with these updates and notify relevant team members for review and feedback.

Out of scope

  • Refactoring of unrelated tests or additional enhancements beyond updating waitForNextUpdate.
  • Tests that are outside of the cloud_security_posture plugin or the Agentelss scope in the fleet plugin

Related tasks/epics

@opauloh opauloh added the Team:Cloud Security Cloud Security team related label Oct 29, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

@opauloh opauloh self-assigned this Oct 29, 2024
@opauloh opauloh changed the title Update Deprecated waitForNextUpdate Hook to waitFor in Testing Library [Cloud Security] Update Deprecated waitForNextUpdate Hook to waitFor Oct 31, 2024
@opauloh opauloh changed the title [Cloud Security] Update Deprecated waitForNextUpdate Hook to waitFor Update Deprecated waitForNextUpdate Hook to waitFor Oct 31, 2024
@opauloh
Copy link
Contributor Author

opauloh commented Nov 13, 2024

Closing as the changes are planned by this PR already implementing an ESLint rule to prevent further usage of waitForNextUpdate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants