diff --git a/src/browser/fixture.js b/src/browser/fixture.js index b57f55c5..b82e39ee 100644 --- a/src/browser/fixture.js +++ b/src/browser/fixture.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + import { nextFrame, fixture as wcFixture } from '@open-wc/testing'; import { reset } from './reset.js'; @@ -48,7 +50,9 @@ async function waitForElem(elem, awaitLoadingComplete = true) { } export async function fixture(element, opts = {}) { + console.log('before reset'); await Promise.all([reset(opts), document.fonts.ready]); + console.log('after reset'); const elem = await wcFixture(element); await waitForElem(elem, opts.awaitLoadingComplete); diff --git a/src/browser/reset.js b/src/browser/reset.js index 558f712c..991d1e7e 100644 --- a/src/browser/reset.js +++ b/src/browser/reset.js @@ -16,12 +16,10 @@ let currentLang = undefined, shouldResetMouse = false; export function requestMouseReset() { - console.log('requestMouseReset'); shouldResetMouse = true; } export async function reset(opts) { - opts = opts || {}; opts.lang = opts.lang || DEFAULT_LANG; opts.mathjax = opts.mathjax || {}; @@ -37,10 +35,7 @@ export async function reset(opts) { if (shouldResetMouse) { shouldResetMouse = false; - console.log('resetting mouse'); - const start = new Date().getTime(); await sendMouse({ type: 'move', position: [0, 0] }).catch(() => {}); - console.log('took', new Date().getTime() - start); } if (document.activeElement !== document.body) { diff --git a/test/browser/commands.test.js b/test/browser/commands.test.js index c5ce639a..4b3bbe9d 100644 --- a/test/browser/commands.test.js +++ b/test/browser/commands.test.js @@ -1,3 +1,5 @@ +/* eslint no-console: 0 */ + import { clickAt, clickElem, expect, fixture, focusElem, hoverAt, hoverElem, sendKeys, sendKeysElem } from '../../src/browser/index.js'; import { html } from 'lit'; import { spy } from 'sinon'; @@ -7,7 +9,9 @@ describe('commands', () => { let elem; const input = html``; beforeEach(async() => { + console.log('before fixture'); elem = await fixture(input); + console.log('after fixture'); }); it('should click on element', async() => {