Skip to content

Commit 530f5ba

Browse files
committed
refactor(tests): remove dpr from size assertions in Android and iOS device tests
1 parent 1ba770e commit 530f5ba

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

packages/android/tests/unit-test/page.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ describe('AndroidDevice', () => {
125125
const size1 = await device.size();
126126
const size2 = await device.size();
127127

128-
expect(size1).toEqual({ width: 540, height: 960, dpr: 2 });
128+
expect(size1).toEqual({ width: 540, height: 960 });
129129
expect(size2).toEqual(size1);
130130
// Caching is removed, so it should be called twice
131131
expect(vi.spyOn(device as any, 'getScreenSize')).toHaveBeenCalledTimes(2);
@@ -1343,7 +1343,7 @@ describe('AndroidDevice', () => {
13431343
expect(mockAdbInstance.shell).toHaveBeenCalledWith('dumpsys display');
13441344
expect(size.width).toBe(411); // 1080 / (420/160) ≈ 411
13451345
expect(size.height).toBe(731); // 1920 / (420/160) ≈ 731
1346-
expect(size.dpr).toBe(2.625); // 420 / 160 = 2.625
1346+
// dpr is no longer returned in size()
13471347
});
13481348

13491349
it('should use display ID for screenshots by default when displayId is set', async () => {

packages/ios/tests/unit-test/device.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ describe('IOSDevice', () => {
186186
expect(size).toEqual({
187187
width: 375,
188188
height: 812,
189-
dpr: 2,
190189
});
191190
expect(mockWdaClient.getWindowSize).toHaveBeenCalled();
192191
});
@@ -298,7 +297,6 @@ describe('IOSDevice', () => {
298297
expect(size).toEqual({
299298
width: 375,
300299
height: 812,
301-
dpr: 2,
302300
});
303301
});
304302

@@ -472,11 +470,6 @@ describe('IOSDevice', () => {
472470
await device.connect();
473471
});
474472

475-
it('should calculate DPR correctly', async () => {
476-
const size = await device.size();
477-
expect(size.dpr).toBe(2); // DPR from mocked getScreenScale
478-
});
479-
480473
it('should handle different screen sizes', async () => {
481474
mockWdaClient.getWindowSize = vi
482475
.fn()

0 commit comments

Comments
 (0)