testing-library / testing-library/angular-testing-library
How to test components with ViewEncapsulation.ShadowDom?
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 792
- Forks
- 95
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 3
Description
Hi, I'm testing component that used as WebComponent (Angular Element).
And I want to enable shadow DOM encapsulation.
@Component({
// ...
encapsulation: ViewEncapsulation.ShadowDom // <- This!
})
But if shadow DOM encapsulation is enabled, Angular Testing Library seems failed find elements in shadow DOM.
Is there anything I can solve this problem?
Thanks.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the Angular component test with ViewEncapsulation.ShadowDom enabled for an Angular Element, then inspect how Angular Testing Library queries the rendered component. Done means establishing whether elements inside the shadow DOM can be found and documenting or implementing the required behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- angular, typescript
- Domain
- frontend, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100