From ece4709a45f897c83526d7bb889a88194bb8888d Mon Sep 17 00:00:00 2001 From: Spencer Date: Wed, 26 Jun 2019 07:50:56 -0700 Subject: [PATCH] =?UTF-8?q?[7.x]=20[percy]=20define=20snapshot=20width=20t?= =?UTF-8?q?o=20match=20current=20client=20wi=E2=80=A6=20(#39648)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/visual_testing/take_percy_snapshot.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/visual_regression/services/visual_testing/take_percy_snapshot.js b/test/visual_regression/services/visual_testing/take_percy_snapshot.js index f677e2fd2e604..8103a2a3d606a 100644 --- a/test/visual_regression/services/visual_testing/take_percy_snapshot.js +++ b/test/visual_regression/services/visual_testing/take_percy_snapshot.js @@ -46,7 +46,9 @@ export function takePercySnapshot() { } // cache the dom snapshot containing the images - const snapshot = agent.domSnapshot(document); + const snapshot = agent.snapshot(document, { + widths: [document.documentElement.clientWidth] + }); // restore replaced canvases for (const { image, canvas } of replacements) { @@ -59,5 +61,5 @@ export function takePercySnapshot() { export const takePercySnapshotWithAgent = ` ${readFileSync(agentJsFilename(), 'utf8')} - return (${takePercySnapshot.toString()})(); + return (${takePercySnapshot.toString()}).apply(null, arguments); `;