@chromatic-com/playwright 0.14.4 → 0.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3804,8 +3804,7 @@ var _DOMSnapshot = class _DOMSnapshot {
3804
3804
  const currentSrc = this.mapSrcsetUrls(srcsetValue, sourceMap);
3805
3805
  if (currentSrc) {
3806
3806
  node.attributes.src = currentSrc;
3807
- delete node.attributes.srcset;
3808
- delete node.attributes.sizes;
3807
+ this.removeResponsiveImageAttributes(node.attributes);
3809
3808
  }
3810
3809
  }
3811
3810
  if (node.tagName === "picture") {
@@ -3830,6 +3829,7 @@ var _DOMSnapshot = class _DOMSnapshot {
3830
3829
  const imageElement = node.childNodes.find((childNode) => childNode.type === NodeType.Element && childNode.tagName === "img");
3831
3830
  if (imageElement && imageElement.attributes) {
3832
3831
  imageElement.attributes.src = sourceMap.get(matchingUrl);
3832
+ this.removeResponsiveImageAttributes(imageElement.attributes);
3833
3833
  }
3834
3834
  }
3835
3835
  }
@@ -3864,6 +3864,10 @@ var _DOMSnapshot = class _DOMSnapshot {
3864
3864
  });
3865
3865
  return currentSrc;
3866
3866
  }
3867
+ removeResponsiveImageAttributes(attributes) {
3868
+ delete attributes.srcset;
3869
+ delete attributes.sizes;
3870
+ }
3867
3871
  };
3868
3872
  __name(_DOMSnapshot, "DOMSnapshot");
3869
3873
  var DOMSnapshot = _DOMSnapshot;
@@ -4216,38 +4220,21 @@ var performChromaticSnapshot = /* @__PURE__ */ __name(async ({ page, delay, diff
4216
4220
  }
4217
4221
  const resourceArchive = await completeArchive();
4218
4222
  const snapshots = chromaticSnapshots.get(testId) || /* @__PURE__ */ new Map();
4219
- const chromaticStorybookParams = {
4220
- ...delay && {
4221
- delay
4222
- },
4223
- ...diffIncludeAntiAliasing && {
4224
- diffIncludeAntiAliasing
4225
- },
4226
- ...diffThreshold && {
4227
- diffThreshold
4228
- },
4229
- ...forcedColors && {
4230
- forcedColors
4231
- },
4232
- ...pauseAnimationAtEnd && {
4233
- pauseAnimationAtEnd
4234
- },
4235
- ...prefersReducedMotion && {
4236
- prefersReducedMotion
4237
- },
4238
- ...cropToViewport && {
4239
- cropToViewport
4240
- },
4241
- ...ignoreSelectors && {
4242
- ignoreSelectors
4243
- }
4244
- };
4245
4223
  const outputDir = path2.join(testInfo.outputDir, "..");
4246
4224
  await writeTestResult({
4247
4225
  ...testInfo,
4248
4226
  outputDir,
4249
4227
  pageUrl: page.url()
4250
- }, Object.fromEntries(snapshots), resourceArchive, chromaticStorybookParams);
4228
+ }, Object.fromEntries(snapshots), resourceArchive, {
4229
+ delay,
4230
+ diffIncludeAntiAliasing,
4231
+ diffThreshold,
4232
+ forcedColors,
4233
+ pauseAnimationAtEnd,
4234
+ prefersReducedMotion,
4235
+ cropToViewport,
4236
+ ignoreSelectors
4237
+ });
4251
4238
  trackComplete();
4252
4239
  } finally {
4253
4240
  chromaticSnapshots.delete(testId);
package/dist/index.mjs CHANGED
@@ -3798,8 +3798,7 @@ var _DOMSnapshot = class _DOMSnapshot {
3798
3798
  const currentSrc = this.mapSrcsetUrls(srcsetValue, sourceMap);
3799
3799
  if (currentSrc) {
3800
3800
  node.attributes.src = currentSrc;
3801
- delete node.attributes.srcset;
3802
- delete node.attributes.sizes;
3801
+ this.removeResponsiveImageAttributes(node.attributes);
3803
3802
  }
3804
3803
  }
3805
3804
  if (node.tagName === "picture") {
@@ -3824,6 +3823,7 @@ var _DOMSnapshot = class _DOMSnapshot {
3824
3823
  const imageElement = node.childNodes.find((childNode) => childNode.type === NodeType.Element && childNode.tagName === "img");
3825
3824
  if (imageElement && imageElement.attributes) {
3826
3825
  imageElement.attributes.src = sourceMap.get(matchingUrl);
3826
+ this.removeResponsiveImageAttributes(imageElement.attributes);
3827
3827
  }
3828
3828
  }
3829
3829
  }
@@ -3858,6 +3858,10 @@ var _DOMSnapshot = class _DOMSnapshot {
3858
3858
  });
3859
3859
  return currentSrc;
3860
3860
  }
3861
+ removeResponsiveImageAttributes(attributes) {
3862
+ delete attributes.srcset;
3863
+ delete attributes.sizes;
3864
+ }
3861
3865
  };
3862
3866
  __name(_DOMSnapshot, "DOMSnapshot");
3863
3867
  var DOMSnapshot = _DOMSnapshot;
@@ -4210,38 +4214,21 @@ var performChromaticSnapshot = /* @__PURE__ */ __name(async ({ page, delay, diff
4210
4214
  }
4211
4215
  const resourceArchive = await completeArchive();
4212
4216
  const snapshots = chromaticSnapshots.get(testId) || /* @__PURE__ */ new Map();
4213
- const chromaticStorybookParams = {
4214
- ...delay && {
4215
- delay
4216
- },
4217
- ...diffIncludeAntiAliasing && {
4218
- diffIncludeAntiAliasing
4219
- },
4220
- ...diffThreshold && {
4221
- diffThreshold
4222
- },
4223
- ...forcedColors && {
4224
- forcedColors
4225
- },
4226
- ...pauseAnimationAtEnd && {
4227
- pauseAnimationAtEnd
4228
- },
4229
- ...prefersReducedMotion && {
4230
- prefersReducedMotion
4231
- },
4232
- ...cropToViewport && {
4233
- cropToViewport
4234
- },
4235
- ...ignoreSelectors && {
4236
- ignoreSelectors
4237
- }
4238
- };
4239
4217
  const outputDir = join(testInfo.outputDir, "..");
4240
4218
  await writeTestResult({
4241
4219
  ...testInfo,
4242
4220
  outputDir,
4243
4221
  pageUrl: page.url()
4244
- }, Object.fromEntries(snapshots), resourceArchive, chromaticStorybookParams);
4222
+ }, Object.fromEntries(snapshots), resourceArchive, {
4223
+ delay,
4224
+ diffIncludeAntiAliasing,
4225
+ diffThreshold,
4226
+ forcedColors,
4227
+ pauseAnimationAtEnd,
4228
+ prefersReducedMotion,
4229
+ cropToViewport,
4230
+ ignoreSelectors
4231
+ });
4245
4232
  trackComplete();
4246
4233
  } finally {
4247
4234
  chromaticSnapshots.delete(testId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromatic-com/playwright",
3
- "version": "0.14.4",
3
+ "version": "0.14.5",
4
4
  "description": "Chromatic Visual Regression Testing for Playwright",
5
5
  "repository": {
6
6
  "type": "git",