From ae3be09301bc00cc198ebbbb350a240cae0f7c95 Mon Sep 17 00:00:00 2001 From: Teemu Koivisto Date: Tue, 28 May 2024 23:27:37 +0300 Subject: [PATCH] change thresholds --- .../cypress/e2e/devtools.spec.cy.ts | 10 +++++----- .../cypress/e2e/history-tab.spec.cy.ts | 12 ++++++------ .../cypress/e2e/plugins-tab.spec.cy.ts | 2 +- .../cypress/e2e/schema-tab.spec.cy.ts | 4 ++-- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/prosemirror-dev-toolkit/cypress/e2e/devtools.spec.cy.ts b/packages/prosemirror-dev-toolkit/cypress/e2e/devtools.spec.cy.ts index 352866c..ee09fd6 100644 --- a/packages/prosemirror-dev-toolkit/cypress/e2e/devtools.spec.cy.ts +++ b/packages/prosemirror-dev-toolkit/cypress/e2e/devtools.spec.cy.ts @@ -1,4 +1,4 @@ -const TEST_TEXT1 = 'asdf qwer' +const TEST_TEXT = 'asdf qwer' describe('# DevTools', () => { it('Should render and allow to be closed / reopened', () => { @@ -44,10 +44,10 @@ describe('# DevTools', () => { cy.devTools().find('ul.tabs-menu li button').contains('HISTORY').click() cy.devTools().find('.left-panel').find('li').should('have.length', 0) - cy.pmInsParagraphBolded(TEST_TEXT1) + cy.pmInsParagraphBolded(TEST_TEXT) cy.devTools().find('.left-panel').find('li').should('have.length', 1) - cy.pmInsParagraphBolded(TEST_TEXT1) + cy.pmInsParagraphBolded(TEST_TEXT) cy.devTools().find('.left-panel').find('li').should('have.length', 2) cy.window().then(async window => { @@ -59,7 +59,7 @@ describe('# DevTools', () => { cy.devTools().find('ul.tabs-menu li button').contains('HISTORY').click() cy.devTools().find('.left-panel').find('li').should('have.length', 0) - cy.pmInsParagraphBolded(TEST_TEXT1) + cy.pmInsParagraphBolded(TEST_TEXT) cy.devTools().find('.left-panel').find('li').should('have.length', 1) }) }) @@ -113,7 +113,7 @@ describe('# DevTools', () => { cy.devTools().find('ul.tabs-menu li button').contains('HISTORY').click() cy.devTools().find('.left-panel').find('li').should('have.length', 0) - cy.pmInsParagraphBolded(TEST_TEXT1) + cy.pmInsParagraphBolded(TEST_TEXT) cy.devTools().find('.left-panel').find('li').should('have.length', 1) }) }) diff --git a/packages/prosemirror-dev-toolkit/cypress/e2e/history-tab.spec.cy.ts b/packages/prosemirror-dev-toolkit/cypress/e2e/history-tab.spec.cy.ts index f9a3fc8..7a6fb2f 100644 --- a/packages/prosemirror-dev-toolkit/cypress/e2e/history-tab.spec.cy.ts +++ b/packages/prosemirror-dev-toolkit/cypress/e2e/history-tab.spec.cy.ts @@ -1,6 +1,6 @@ import { TextSelection } from 'prosemirror-state' -const TEST_TEXT2 = 'asdf qwer' +const TEST_TEXT = 'asdf qwer' describe('# History tab', () => { beforeEach(() => { @@ -19,7 +19,7 @@ describe('# History tab', () => { const schema = view.state.schema tr.insert( 1, - schema.nodes.paragraph.create(null, schema.text(TEST_TEXT2, [schema.marks.bold.create()])) + schema.nodes.paragraph.create(null, schema.text(TEST_TEXT, [schema.marks.bold.create()])) ) tr.setSelection(new TextSelection(tr.doc.resolve(4))) tr.setMeta('hello', { recipient: 'world' }) @@ -101,9 +101,9 @@ describe('# History tab', () => { cy.devTools() .find('.right-panel') .matchImage({ - maxDiffThreshold: 0, + maxDiffThreshold: 0.02, diffConfig: { - threshold: 0.0001, + threshold: 0.01, alpha: 0.2 } }) @@ -125,7 +125,7 @@ describe('# History tab', () => { const schema = view.state.schema tr.insert( 1, - schema.nodes.paragraph.create(null, schema.text(TEST_TEXT2, [schema.marks.bold.create()])) + schema.nodes.paragraph.create(null, schema.text(TEST_TEXT, [schema.marks.bold.create()])) ) tr.setSelection(new TextSelection(tr.doc.resolve(4))) view.dispatch(tr) @@ -192,7 +192,7 @@ describe('# History tab', () => { const schema = view.state.schema tr.insert( 1, - schema.nodes.paragraph.create(null, schema.text(TEST_TEXT2, [schema.marks.bold.create()])) + schema.nodes.paragraph.create(null, schema.text(TEST_TEXT, [schema.marks.bold.create()])) ) view.dispatch(tr) tr = view.state.tr diff --git a/packages/prosemirror-dev-toolkit/cypress/e2e/plugins-tab.spec.cy.ts b/packages/prosemirror-dev-toolkit/cypress/e2e/plugins-tab.spec.cy.ts index 2cafac9..ba9f189 100644 --- a/packages/prosemirror-dev-toolkit/cypress/e2e/plugins-tab.spec.cy.ts +++ b/packages/prosemirror-dev-toolkit/cypress/e2e/plugins-tab.spec.cy.ts @@ -1,4 +1,4 @@ -const TEST_TEXT3 = 'asdf qwer' +const TEST_TEXT1 = 'asdf qwer' describe('# Plugins tab', () => { before(() => { diff --git a/packages/prosemirror-dev-toolkit/cypress/e2e/schema-tab.spec.cy.ts b/packages/prosemirror-dev-toolkit/cypress/e2e/schema-tab.spec.cy.ts index 2dc5a3b..c8bd3a6 100644 --- a/packages/prosemirror-dev-toolkit/cypress/e2e/schema-tab.spec.cy.ts +++ b/packages/prosemirror-dev-toolkit/cypress/e2e/schema-tab.spec.cy.ts @@ -53,9 +53,9 @@ describe('# Schema tab', () => { screenshotConfig: { capture: 'viewport' }, - maxDiffThreshold: 0, + maxDiffThreshold: 0.05, diffConfig: { - threshold: 0.0001, + threshold: 0.01, alpha: 0.2 } })