From 9b7f7633180c2da4ae05ec9ee54f18ab1008582c Mon Sep 17 00:00:00 2001 From: Chinmay Maheshwari Date: Tue, 17 Dec 2024 01:38:03 +0530 Subject: [PATCH] Fix test --- test/index.test.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/index.test.mjs b/test/index.test.mjs index c9f8e22..9b2908b 100644 --- a/test/index.test.mjs +++ b/test/index.test.mjs @@ -217,9 +217,10 @@ describe('percySnapshot', () => { const mockedScroll = spyOn(percySnapshot, 'slowScrollToBottom').and.resolveTo(true); + mockedDriver.executeScript.calls.reset(); await percySnapshot(mockedDriver, 'Test Snapshot', { responsiveSnapshotCapture: true }); - expect(mockedDriver.executeScript.calls.allArgs()).toEqual(jasmine.arrayContaining([jasmine.arrayContaining(['return window.outerHeight - window.innerHeight + 900'])])); + expect(mockedDriver.executeScript).toHaveBeenCalledTimes(4); expect(mockedScroll).toHaveBeenCalledWith(mockedDriver, 0.45); delete process.env.PERCY_ENABLE_LAZY_LOADING_SCROLL; delete process.env.PERCY_RESPONSIVE_CAPTURE_MIN_HEIGHT;