Skip to content

Commit 159d046

Browse files
committed
test(wtr): more cleanup
1 parent 97ee6e9 commit 159d046

File tree

1 file changed

+7
-10
lines changed
  • packages/@lwc/integration-not-karma/test/custom-elements-registry

1 file changed

+7
-10
lines changed

packages/@lwc/integration-not-karma/test/custom-elements-registry/index.spec.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,13 @@ async function getEngineCode() {
3434
const injectableCreateLWC = String(function createLWC({
3535
tagName = 'x-foo',
3636
skipInject = false,
37-
text = 'Hello LWC',
3837
globalLWC = 'LWC',
3938
customElement = false,
4039
} = {}) {
4140
// basic "Hello World" compiled LWC component
4241
function tmpl($api) {
4342
const { t: api_text, h: api_element } = $api;
44-
return [api_element('h1', { key: 0 }, [api_text(text)])];
43+
return [api_element('h1', { key: 0 }, [api_text('Hello LWC')])];
4544
}
4645

4746
const LWC = window[globalLWC];
@@ -75,10 +74,8 @@ const injectableCreateLWC = String(function createLWC({
7574
* The text of a function that creates a vanilla custom element.
7675
* The function is injected into an iframe, and must not reference any variables in this file.
7776
*/
78-
const injectableCreateVanilla = String(function createVanilla({
79-
tagName = 'x-foo',
80-
skipInject = false,
81-
} = {}) {
77+
const injectableCreateVanilla = String(function createVanilla({ skipInject = false } = {}) {
78+
const tagName = 'x-foo';
8279
customElements.define(
8380
tagName,
8481
class MyCustomElement extends HTMLElement {
@@ -166,10 +163,10 @@ describe('custom elements registry', () => {
166163
injectEngine();
167164
callInIframe(injectableCreateLWC, { customElement, globalLWC: 'oldLWC' });
168165

169-
expect(
170-
iframe.contentDocument.querySelector('x-foo').shadowRoot.querySelector('h1')
171-
.textContent
172-
).toEqual('Hello LWC');
166+
const text = iframe.contentDocument
167+
.querySelector('x-foo')
168+
.shadowRoot.querySelector('h1').textContent;
169+
expect(text).toEqual('Hello LWC');
173170
});
174171
});
175172
});

0 commit comments

Comments
 (0)