From 27187376e84d1fadaa9afc649573325e880b096b Mon Sep 17 00:00:00 2001 From: Stacey Van Herk <13419300+svanherk@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:08:55 -0400 Subject: [PATCH] Switch logs --- src/browser/fixture.js | 4 ++++ src/browser/reset.js | 5 ----- test/browser/commands.test.js | 4 ++++ 3 files changed, 8 insertions(+), 5 deletions(-) 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() => {