Skip to content

Commit

Permalink
[7.2] [percy] define snapshot width to match current client wi… (#39649)
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer authored Jun 26, 2019
1 parent e2d5a3a commit af8a93c
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 af8a93c

Please sign in to comment.