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

feat(cdk/testing): add option to customise TestElement#text #29324

Open
bgotink opened this issue Jun 26, 2024 · 0 comments
Open

feat(cdk/testing): add option to customise TestElement#text #29324

bgotink opened this issue Jun 26, 2024 · 0 comments
Labels
area: cdk/testing feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@bgotink
Copy link
Contributor

bgotink commented Jun 26, 2024

Feature Description

We use web components in our angular components. We can override the browser's querySelectorAll in the testbed test environment to pierce through shadow roots. We would like to also be able to override the innerText/textContent functionality (for TestElement#text) of the browser as the builtin innerText and textContent properties skips over shadow content:

<angular-component>
  Hello,
  <web-component>
    <template shadowrootmode="open">World!</template>
  </web-component>
</angular-component>

--> document.querySelector('angular-component').innerText === 'Hello, '

image

Use Case

Improve unit testing using component harnesses when web components using shadow DOM are used.

@bgotink bgotink added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels Jun 26, 2024
@bgotink bgotink changed the title feat(cdk/testing): add option to customise innerText feat(cdk/testing): add option to customise TestElement#text Jun 26, 2024
@andrewseguin andrewseguin added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: cdk/testing and removed needs triage This issue needs to be triaged by the team labels Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/testing feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

2 participants