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

Angular CT does not mount component within div[data-cy-root] root element #24385

Closed
ZachJW34 opened this issue Oct 25, 2022 · 2 comments · Fixed by #25807
Closed

Angular CT does not mount component within div[data-cy-root] root element #24385

ZachJW34 opened this issue Oct 25, 2022 · 2 comments · Fixed by #25807
Assignees
Labels
CT Issue related to component testing

Comments

@ZachJW34
Copy link
Contributor

ZachJW34 commented Oct 25, 2022

Current behavior

Angular components are mounted inside a generated top-level div that is outside of our control
Screen Shot 2022-10-25 at 10 58 47 AM

Desired behavior

Angular components should be mounted inside of <div data-cy-root></div> so as to accommodate for custom style specificity and to conform with the rest of our mounting frameworks

Test code to reproduce

Any Angular app with CT setup, check out the DOM inside the AUT iframe to verify once a component has been mounted.

Cypress Version

10.10.0

Other

The rendering of the Angular component is managed by TestBed, specifically the DOMTestComponentRenderer. We could probably override this to always target the data-cy-root element.

@ZachJW34 ZachJW34 added the CT Issue related to component testing label Oct 25, 2022
@ZachJW34
Copy link
Contributor Author

WIP branch overriding the ComponentRenderer to mount into data-cy-root.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 25, 2023

Released in 12.7.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v12.7.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Feb 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CT Issue related to component testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants