Skip to content

Commit

Permalink
fix: snapshots for FF
Browse files Browse the repository at this point in the history
  • Loading branch information
Ni55aN committed Sep 14, 2023
1 parent 3e097d0 commit dbe6dc7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
7 changes: 2 additions & 5 deletions src/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig({
expect: {
timeout: 5000,
toMatchSnapshot: {
maxDiffPixelRatio: 0.001,
maxDiffPixelRatio: 0.003,
threshold: 0.1
}
},
Expand All @@ -31,10 +31,7 @@ export default defineConfig({
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 1,
workers: process.env.CI ? 1 : undefined,
reporter: [
['line'],
process.env.CI ? ['github'] : ['html']
],
reporter: [process.env.CI ? ['github'] : ['list']],
use: {
actionTimeout: 4000,
trace: 'on-first-retry',
Expand Down
4 changes: 2 additions & 2 deletions src/tests/minimap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ test.describe('Minimap', () => {

const before = await getPositions(page, '[data-testid="minimap-node"]')

await move(page, numberNode1, -500, 100)
await move(page, numberNode1, -420, 100)

const after = await getPositions(page, '[data-testid="minimap-node"]')

Expand All @@ -44,7 +44,7 @@ test.describe('Minimap', () => {

expect(isInside(nodesBefore, viewportBefore)).toBeTruthy()

await move(page, area, 1000, 0)
await move(page, area, 900, 0, 'corner')

const nodesAfter = await getPositions(page, '[data-testid="minimap-node"]')
const viewportAfter = await getPositions(page, '[data-testid="minimap-viewport"]')
Expand Down
4 changes: 2 additions & 2 deletions src/tests/perf.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ test.describe('Perf', () => {
test('has nodes', async ({ page }) => {
const { nodes, connections } = await getGraphView(getContainer())

await page.waitForTimeout(1000)
await page.waitForTimeout(3000)
expect(await nodes()).toHaveLength(100)
expect(await connections()).toHaveLength(99)
})

test('snapshot', async ({ page }) => {
await page.waitForTimeout(1000)
await page.waitForTimeout(3000)
expect(await page.screenshot()).toMatchSnapshot('perf.png')
})
})

0 comments on commit dbe6dc7

Please sign in to comment.