Skip to content

Commit

Permalink
update deps, fix types (#78)
Browse files Browse the repository at this point in the history
* fix svelte-check

* try decreasing cypress diff threshold

* again change threshold

* increase thresholds

* change thresholds

* bump threshold

* add changeset
  • Loading branch information
TeemuKoivisto authored May 28, 2024
1 parent 914466e commit e0b293a
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-radios-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"prosemirror-dev-toolkit": patch
---

chore: update deps
14 changes: 7 additions & 7 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 All @@ -18,9 +18,9 @@ describe('# DevTools', () => {
screenshotConfig: {
capture: 'viewport'
},
maxDiffThreshold: 0,
maxDiffThreshold: 0.01,
diffConfig: {
threshold: 0.0001,
threshold: 0.01,
alpha: 0.2
}
})
Expand All @@ -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
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 Down Expand Up @@ -179,9 +179,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 @@ -206,9 +206,9 @@ describe('# History tab', () => {
cy.devTools()
.find('.right-panel')
.matchImage({
maxDiffThreshold: 0,
maxDiffThreshold: 0.01,
diffConfig: {
threshold: 0.0001,
threshold: 0.01,
alpha: 0.2
}
})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const TEST_TEXT = 'asdf qwer'
const TEST_TEXT1 = 'asdf qwer'

describe('# Plugins tab', () => {
before(() => {
Expand Down Expand Up @@ -44,9 +44,9 @@ describe('# Plugins tab', () => {
screenshotConfig: {
capture: 'viewport'
},
maxDiffThreshold: 0,
maxDiffThreshold: 0.04,
diffConfig: {
threshold: 0.0001,
threshold: 0.01,
alpha: 0.2
}
})
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ describe('# State tab', () => {
screenshotConfig: {
capture: 'viewport'
},
maxDiffThreshold: 0,
maxDiffThreshold: 0.025,
diffConfig: {
threshold: 0.0001,
threshold: 0.01,
alpha: 0.2
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/prosemirror-dev-toolkit/cypress/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "es5",
"lib": ["esnext", "dom", "dom.iterable"],
"types": ["node", "cypress", "@testing-library/cypress", "cypress-file-upload"],
"types": ["node", "cypress", "@testing-library/cypress"],
"esModuleInterop": true,
"resolveJsonModule": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ describe('DevTools component', () => {

it('should render', () => {
editor = setupEditor(div)
console.log('hello editor', editor)
const results = render(DevTools, {
props: {
view: editor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
let editedSnap: Snapshot | undefined
let deleteSnap: Snapshot | undefined
let timer: number | undefined
let timer: ReturnType<typeof setTimeout> | undefined
const debounceUpdate = () => {
clearTimeout(timer)
Expand Down
5 changes: 4 additions & 1 deletion packages/prosemirror-dev-toolkit/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import autoPreprocess from 'svelte-preprocess'

/** @type {import('svelte-preprocess/dist/types').AutoPreprocessOptions} */
const preprocessOptions = {
scss: { prependData: `@import 'src/global.scss';` }
scss: {
prependData: `@import 'src/global.scss';`
}
}

export default {
Expand Down

0 comments on commit e0b293a

Please sign in to comment.