@brightspace-ui/testing 1.39.0 → 1.39.1

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@brightspace-ui/testing",
3
3
  "description": "Utilities for testing front-end components and applications",
4
4
  "type": "module",
5
- "version": "1.39.0",
5
+ "version": "1.39.1",
6
6
  "repository": "https://github.com/BrightspaceUI/testing.git",
7
7
  "scripts": {
8
8
  "lint": "npm run lint:eslint && npm run lint:style",
@@ -20,6 +20,7 @@ export class TestInfoManager {
20
20
  testInfo.new = { ...info.new, ...testInfo.new };
21
21
  }
22
22
  testInfo.diff = testInfo.diff || info.diff;
23
+ testInfo.byteSizeDiff = testInfo.byteSizeDiff || info.byteSizeDiff;
23
24
  }
24
25
  const tests = testInfoMap.get(this.key) || {};
25
26
  testInfoMap.set(this.key, { ...tests, [alt]: testInfo });
@@ -303,7 +303,8 @@ export function visualDiff({ updateGoldens = false, runSubset = false } = {}) {
303
303
  new: {
304
304
  byteSize: screenshotSize
305
305
  },
306
- pixelsDiff
306
+ pixelsDiff,
307
+ byteSizeDiff: true
307
308
  }, alt);
308
309
  return { pass: false, message: 'Image diff is clean but the images do not have the same bytes.' };
309
310
  }
@@ -104,9 +104,9 @@ function flattenResults(session, browserData, fileData) {
104
104
  });
105
105
  }
106
106
  const testData = fileData.tests.get(testName);
107
- const bytediff = !t.passed && info?.diff === undefined && info?.pixelsDiff === 0;
108
- if (!t.passed) {
109
- if (bytediff) {
107
+ const passed = !!(info.golden) && !(info.pixelsDiff) && !(info.byteSizeDiff);
108
+ if (!passed) {
109
+ if (info.byteSizeDiff) {
110
110
  browserData.numByteDiff++;
111
111
  testData.numByteDiff++;
112
112
  }
@@ -117,8 +117,8 @@ function flattenResults(session, browserData, fileData) {
117
117
  name: browserData.name,
118
118
  duration: t.duration,
119
119
  error: t.error?.message,
120
- passed: t.passed,
121
- bytediff,
120
+ passed,
121
+ bytediff: info.byteSizeDiff,
122
122
  info: info
123
123
  });
124
124
  }