add an extra click in nav test to force nav to rerender #583
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed changes
Somehow the nav test started failing. Looking into it clicking on a parent item, doesn't seem to always open/show the sub nav list in the test. Manual testing passes for this for me, when I click around I see the subnav right away (unless I click on the WordPress admin link for these pages, then the subnav doesn't appear). I think it has something to do with this document.click and the SubMenusManager here (https://github.com/bluehost/bluehost-wordpress-plugin/blob/main/src/app/components/app-nav/index.js#L75). I'm still not sure why it works when I click and doesn't when cypress clicks, but might be related to event bubbling up the dom and maybe it doesn't go as far when triggered by cypress.
This adds an extra click and makes the tests pass for now, but we should sort this out. It's likely only a nuisance for a user every once in a while. Maybe we wait and fix in our new UI components? Or if we fix it sooner, we should make sure the fix is incorporated into the new nav components.
Type of Change
Checklist
Further comments