Skip to content

Commit

Permalink
chore: clean test logs
Browse files Browse the repository at this point in the history
  • Loading branch information
tlouisse committed Jan 7, 2025
1 parent 2823940 commit fef94cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/ui/components/core/test/ScopedElementsMixin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ describe('ScopedElementsMixin', () => {
}
customElements.define('scoped-elements-host-no-reg-2', ScopedElementsHostNoReg2);

const errorSpy = sinon.spy(console, 'error');
const errorStub = sinon.stub(console, 'error');
/** @type {ScopedElementsHostNoReg2} */ (
await fixture(html`<scoped-elements-host-no-reg></scoped-elements-host-no-reg>`)
);
/** @type {ScopedElementsHostNoReg2} */ (
await fixture(html`<scoped-elements-host-no-reg-2></scoped-elements-host-no-reg-2>`)
);

expect(errorSpy.args[0][0]).to.equal(
expect(errorStub.args[0][0]).to.equal(
[
'You are trying to re-register the "scoped-elements-child-no-reg" custom element with a different class via ScopedElementsMixin.',
'This is only possible with a CustomElementRegistry.',
Expand All @@ -158,7 +158,7 @@ describe('ScopedElementsMixin', () => {
'For more details you can visit https://open-wc.org/docs/development/scoped-elements/',
].join('\n'),
);
errorSpy.restore();
errorStub.restore();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { html } from 'lit';
import { isActiveElement } from '../../core/test-helpers/isActiveElement.js';
import { getAllTagNames } from './helpers/helpers.js';
import './helpers/umbrella-form.js';

/**
* @typedef {import('./helpers/umbrella-form.js').UmbrellaForm} UmbrellaForm
* @typedef {import('../../dialog/src/LionDialog.js').LionDialog} LionDialog
Expand All @@ -25,10 +26,12 @@ describe('Form inside dialog Integrations', () => {
</lion-dialog>`,
);

// @ts-ignore
const formEl = /** @type {LionForm} */ (el._overlayCtrl.contentNode._lionFormNode);
// @ts-expect-error [allow-protected-in-tests]
const umbrellaEl = el._overlayCtrl.contentNode;
const formEl = /** @type {LionForm} */ (umbrellaEl._lionFormNode);
await formEl.registrationComplete;
const registeredEls = getAllTagNames(formEl);
await umbrellaEl.waitForAllChildrenUpdates();

expect(registeredEls).to.eql([
'lion-fieldset',
Expand Down Expand Up @@ -86,6 +89,7 @@ describe('Form inside dialog Integrations', () => {
</div>
</lion-dialog>
`);

// @ts-expect-error [allow-protected-in-tests]
el._overlayInvokerNode.click();
const lionInput = el.querySelector('[name="input"]');
Expand Down
3 changes: 3 additions & 0 deletions web-test-runner.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ export default {
playwrightLauncher({ product: 'webkit' }),
],
groups,
filterBrowserLogs(/** @type {{ type: 'error'|'warn'|'debug'; args: string[] }} */ log) {
return log.type === 'error' || log.type === 'debug';
},
plugins: [litSsrPlugin()],
};

0 comments on commit fef94cd

Please sign in to comment.