Skip to content

Commit e5d023e

Browse files
committed
chore: update test
1 parent 42956e4 commit e5d023e

File tree

1 file changed

+34
-19
lines changed

1 file changed

+34
-19
lines changed

packages/webdriver-image-comparison/src/methods/screenshots.test.ts

Lines changed: 34 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { describe, it, expect, vi } from 'vitest'
22
import { getBase64FullPageScreenshotsData } from './screenshots.js'
33
import type { FullPageScreenshotDataOptions } from './screenshots.interfaces.js'
44
import { IMAGE_STRING } from '../mocks/mocks.js'
5+
import { DEVICE_RECTANGLES } from '../helpers/constants.js'
56

67
describe('screenshots', () => {
78
describe('getBase64FullPageScreenshotsData', () => {
@@ -11,8 +12,10 @@ describe('screenshots', () => {
1112
const options: FullPageScreenshotDataOptions = {
1213
addressBarShadowPadding: 6,
1314
devicePixelRatio: 1,
14-
// @ts-expect-error
15-
deviceRectangles: { viewport: { x: 0, y: 0, width: 1366, height: 768 } },
15+
deviceRectangles: {
16+
...DEVICE_RECTANGLES,
17+
viewport: { x: 0, y: 0, width: 1366, height: 768 }
18+
},
1619
fullPageScrollTimeout: 1,
1720
innerHeight: 800,
1821
isAndroid: true,
@@ -55,8 +58,10 @@ describe('screenshots', () => {
5558
const options: FullPageScreenshotDataOptions = {
5659
addressBarShadowPadding: 6,
5760
devicePixelRatio: 1,
58-
// @ts-expect-error
59-
deviceRectangles: { viewport: { x: 0, y: 0, width: 1366, height: 768 } },
61+
deviceRectangles: {
62+
...DEVICE_RECTANGLES,
63+
viewport: { x: 0, y: 0, width: 1366, height: 768 }
64+
},
6065
fullPageScrollTimeout: 1,
6166
innerHeight: 600,
6267
isAndroid: true,
@@ -104,8 +109,10 @@ describe('screenshots', () => {
104109
const options: FullPageScreenshotDataOptions = {
105110
addressBarShadowPadding: 6,
106111
devicePixelRatio: 2,
107-
// @ts-expect-error
108-
deviceRectangles: { viewport: { left: 0, top: 0, width: 1366, height: 768 } },
112+
deviceRectangles: {
113+
...DEVICE_RECTANGLES,
114+
viewport: { x: 0, y: 0, width: 1366, height: 768 }
115+
},
109116
fullPageScrollTimeout: 1,
110117
innerHeight: 800,
111118
isAndroid: true,
@@ -150,8 +157,10 @@ describe('screenshots', () => {
150157
const options: FullPageScreenshotDataOptions = {
151158
addressBarShadowPadding: 6,
152159
devicePixelRatio: 2,
153-
// @ts-expect-error
154-
deviceRectangles: { viewport: { left: 0, top: 0, width: 1366, height: 768 } },
160+
deviceRectangles: {
161+
...DEVICE_RECTANGLES,
162+
viewport: { x: 0, y: 0, width: 1366, height: 768 }
163+
},
155164
fullPageScrollTimeout: 1,
156165
innerHeight: 800,
157166
isAndroid: true,
@@ -200,14 +209,15 @@ describe('screenshots', () => {
200209
const options: FullPageScreenshotDataOptions = {
201210
addressBarShadowPadding: 6,
202211
devicePixelRatio: 2,
203-
// @ts-expect-error
204-
deviceRectangles: { viewport: { x: 0, y: 0, width: 1366, height: 768 } },
212+
deviceRectangles: {
213+
...DEVICE_RECTANGLES,
214+
viewport: { x: 0, y: 0, width: 1366, height: 768 }
215+
},
205216
fullPageScrollTimeout: 1,
206217
innerHeight: 800,
207218
isAndroid: false,
208219
isAndroidNativeWebScreenshot: false,
209220
isAndroidChromeDriverScreenshot: false,
210-
isHybridApp: false,
211221
isIOS: true,
212222
isLandscape: false,
213223
toolBarShadowPadding: 6,
@@ -246,8 +256,10 @@ describe('screenshots', () => {
246256
const options: FullPageScreenshotDataOptions = {
247257
addressBarShadowPadding: 6,
248258
devicePixelRatio: 2,
249-
// @ts-expect-error
250-
deviceRectangles: { viewport: { x: 0, y: 0, width: 1366, height: 768 } },
259+
deviceRectangles: {
260+
...DEVICE_RECTANGLES,
261+
viewport: { x: 0, y: 0, width: 1366, height: 768 }
262+
},
251263
fullPageScrollTimeout: 1,
252264
innerHeight: 400,
253265
isAndroid: false,
@@ -291,8 +303,10 @@ describe('screenshots', () => {
291303
const options: FullPageScreenshotDataOptions = {
292304
addressBarShadowPadding: 6,
293305
devicePixelRatio: 2,
294-
// @ts-expect-error
295-
deviceRectangles: { viewport: { x: 0, y: 0, width: 1366, height: 768 } },
306+
deviceRectangles: {
307+
...DEVICE_RECTANGLES,
308+
viewport: { x: 0, y: 0, width: 1366, height: 768 }
309+
},
296310
fullPageScrollTimeout: 1,
297311
innerHeight: 800,
298312
isAndroid: false,
@@ -340,8 +354,10 @@ describe('screenshots', () => {
340354
const options: FullPageScreenshotDataOptions = {
341355
addressBarShadowPadding: 6,
342356
devicePixelRatio: 2,
343-
// @ts-expect-error
344-
deviceRectangles: { viewport: { x: 0, y: 0, width: 0, height: 0 } },
357+
deviceRectangles: {
358+
...DEVICE_RECTANGLES,
359+
viewport: { x: 0, y: 0, width: 0, height: 0 }
360+
},
345361
fullPageScrollTimeout: 1,
346362
innerHeight: 768,
347363
isAndroid: false,
@@ -393,8 +409,7 @@ describe('screenshots', () => {
393409
const options: FullPageScreenshotDataOptions = {
394410
addressBarShadowPadding: 6,
395411
devicePixelRatio: 2,
396-
// @ts-expect-error
397-
deviceRectangles: { viewport: { left: 0, top: 0, width: 0, height: 0 } },
412+
deviceRectangles: DEVICE_RECTANGLES,
398413
fullPageScrollTimeout: 1,
399414
innerHeight: 768,
400415
isAndroid: false,

0 commit comments

Comments
 (0)