-
Notifications
You must be signed in to change notification settings - Fork 91
Component with attribute selector #263
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
Comments
Thanks for creating this issue @mleimer . Updating the example is also a good point that you bring up. Do you want to create a PR for one/both of these suggestions? |
I created a PR at #264
|
Thanks for your help @mleimer |
🎉 This issue has been resolved in version 11.0.0-beta.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Problem
Based on the examples https://github.com/testing-library/angular-testing-library/blob/main/apps/example-app/src/app/examples/02-input-output.ts and https://github.com/testing-library/angular-testing-library/blob/main/apps/example-app/src/app/examples/02-input-output.spec.ts
Given that a component contains an attribute within its selector
e.g.
app-fixture[value]
Then it is not possible to render the component with:
await render(InputOutputComponent, { componentProperties: { value: 47, sendValue: { emit: sendValue, } as any, }, });
Instead, the template way must be chosen:
await render('<app-fixture [value]="47" (sendValue)="sendValue($event)" (clicked)="clicked()"></app-fixture>', { declarations: ['InputOutputComponent'], componentProperties: { sendValue: sendSpy, }, });
Suggestion
render
does not work with attribute components OR if there is a way to make it work, enhance the code baserender
-method where the template is passed as a property in the second argument instead of the first argument.The text was updated successfully, but these errors were encountered: