File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,13 @@ test('my-app: should render message', async t => {
3737 // In Shadow DOM open mode, shadowRoot is also accessible through DOM API
3838 // node.shadowRoot
3939 // But only Aurelia API can access shadowRoot in both open and closed mode.
40- const text = CustomElement.for(node).projector.shadowRoot.textContent;
40+ const shadowRoot = CustomElement.for(node).projector.provideEncapsulationSource();
41+ // @if babel
42+ const text = shadowRoot.textContent;
43+ // @endif
44+ // @if typescript
45+ const text = (shadowRoot as Node).textContent;
46+ // @endif
4147 // @endif
4248 // @if !shadow-dom
4349 const text = node.textContent;
@@ -69,7 +75,13 @@ describe('my-app', () => {
6975 // In Shadow DOM open mode, shadowRoot is also accessible through DOM API
7076 // node.shadowRoot
7177 // But only Aurelia API can access shadowRoot in both open and closed mode.
72- const text = CustomElement.for(node).projector.shadowRoot.textContent;
78+ const shadowRoot = CustomElement.for(node).projector.provideEncapsulationSource();
79+ // @if babel
80+ const text = shadowRoot.textContent;
81+ // @endif
82+ // @if typescript
83+ const text = (shadowRoot as Node).textContent;
84+ // @endif
7385 // @endif
7486 // @if !shadow-dom
7587 const text = node.textContent;
You can’t perform that action at this time.
0 commit comments