[7.x] [percy] define snapshot width to match current client wi… (#39648)

This commit is contained in:
Spencer 2019-06-26 07:50:56 -07:00 committed by GitHub
parent f3742b8728
commit ece4709a45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);
`;