Skip to content

Commit

Permalink
change thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
TeemuKoivisto committed May 28, 2024
1 parent 64b44a6 commit ae3be09
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
10 changes: 5 additions & 5 deletions packages/prosemirror-dev-toolkit/cypress/e2e/devtools.spec.cy.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand Down Expand Up @@ -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 => {
Expand All @@ -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)
})
})
Expand Down Expand Up @@ -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)
})
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TextSelection } from 'prosemirror-state'

const TEST_TEXT2 = 'asdf qwer'
const TEST_TEXT = 'asdf qwer'

describe('# History tab', () => {
beforeEach(() => {
Expand All @@ -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' })
Expand Down Expand Up @@ -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
}
})
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const TEST_TEXT3 = 'asdf qwer'
const TEST_TEXT1 = 'asdf qwer'

describe('# Plugins tab', () => {
before(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
})
Expand Down

0 comments on commit ae3be09

Please sign in to comment.