Skip to content

Commit

Permalink
[7.x] [percy] define snapshot width to match current client wi… (#39648)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored Jun 26, 2019
1 parent f3742b8 commit ece4709
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -59,5 +61,5 @@ export function takePercySnapshot() {
export const takePercySnapshotWithAgent = `
${readFileSync(agentJsFilename(), 'utf8')}
return (${takePercySnapshot.toString()})();
return (${takePercySnapshot.toString()}).apply(null, arguments);
`;

0 comments on commit ece4709

Please sign in to comment.