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

Add Standalone Support for Angular Component Testing #23125

Closed
jordanpowell88 opened this issue Aug 4, 2022 · 2 comments
Closed

Add Standalone Support for Angular Component Testing #23125

jordanpowell88 opened this issue Aug 4, 2022 · 2 comments
Assignees
Labels
npm: @cypress/angular @cypress/angular package issues

Comments

@jordanpowell88
Copy link
Contributor

What would you like?

The current release of angular component testing does not currently support standalone components. This is a new a promising feature that was recently released in angular 14 that we want to add support for. The good news is that adding support should require just a tiny tweak to the mount api.

The issue is that by default we take the component passed into the mount as the first parameter when provided the class definition ie: cy.mount(MyComopnent) and we pass it to the declarations array of the TestBed. However, in a standalone application, this is no longer valid as it needs to be passed to the imports array instead.

We need to add a check for if a component set to use standalone and if so push the component into the imports array instead of the declarations array.

Why is this needed?

This is needed because having support for standalone components out of the box in angular will go a long way for overall adoption.

Other

We use to have this support but it got squashed out. We need to also add a system test for this so we validate this support moving forward.

@mschile
Copy link
Contributor

mschile commented Aug 15, 2022

The code for this is done in #23117, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@mschile mschile closed this as completed Aug 15, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Aug 15, 2022

Released in 10.5.0.

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

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
npm: @cypress/angular @cypress/angular package issues
Projects
None yet
Development

No branches or pull requests

2 participants