@percy/report 1.0.2 → 1.0.3
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 +1 -1
- package/src/template/report.html +6 -14
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@percy/report",
|
|
3
3
|
"description": "Package to generate a build report and project summary report for Percy, BrowserStack's visual testing platform",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.3",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "BrowserStack Pvt Ltd",
|
package/src/template/report.html
CHANGED
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
let diffRatios = current.comparisons.map((c) => Number(c['diff-percentage']))
|
|
198
198
|
current['diff-ratios'] = diffRatios;
|
|
199
199
|
current['max-diff'] = Math.max(...diffRatios);
|
|
200
|
-
const isChanged =
|
|
200
|
+
const isChanged = current.comparisons.some((c)=>c.images && (c.images.diff || !c.images.base))
|
|
201
201
|
if (isChanged) {
|
|
202
202
|
map.changed.push(current)
|
|
203
203
|
} else {
|
|
@@ -239,7 +239,7 @@
|
|
|
239
239
|
const Picker = function (props) {
|
|
240
240
|
React.useEffect(() => {
|
|
241
241
|
if (props.items.length > 0 && !props.items.includes(props.value)) {
|
|
242
|
-
props.onChange(props.items
|
|
242
|
+
props.onChange(props.items[0])
|
|
243
243
|
}
|
|
244
244
|
}, [props])
|
|
245
245
|
if (!props.items || props.items.length == 0) {
|
|
@@ -310,13 +310,13 @@
|
|
|
310
310
|
|
|
311
311
|
function App() {
|
|
312
312
|
const [filters, SetFilters] = React.useState(() => {
|
|
313
|
-
const snapshot = BuildData.details
|
|
314
|
-
const comparison = snapshot && snapshot.comparisons
|
|
313
|
+
const snapshot = BuildData.details[0]
|
|
314
|
+
const comparison = snapshot && snapshot.comparisons[0]
|
|
315
315
|
return {
|
|
316
316
|
snapshots: 'changed',
|
|
317
317
|
diffThreshold: 0,
|
|
318
318
|
search: '',
|
|
319
|
-
activeSnapshot: snapshot ? BuildData.details
|
|
319
|
+
activeSnapshot: snapshot ? BuildData.details[0].name : '',
|
|
320
320
|
activeBrowser: comparison ? comparison.browser : null,
|
|
321
321
|
activeWidth: comparison ? comparison.width : null,
|
|
322
322
|
activeDevice: comparison ? comparison.device : null
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
}
|
|
401
401
|
const PrevSnapshot = () => {
|
|
402
402
|
if (activeSnapshot && activeSnapshot.index > 0) {
|
|
403
|
-
SetFilter({ activeSnapshot: snapshots
|
|
403
|
+
SetFilter({ activeSnapshot: snapshots[activeSnapshot.index - 1].name })
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
const getImage = (comp, kind) => {
|
|
@@ -448,14 +448,6 @@
|
|
|
448
448
|
<p className="text-start flex-1 capitalize">Unreviewed Snapshots</p>
|
|
449
449
|
<p >{BuildData['unreviewedScreenshots']}</p>
|
|
450
450
|
</div>
|
|
451
|
-
<div className={`flex p-1 rounded`}>
|
|
452
|
-
<p className="text-start flex-1 capitalize">Total Screenshots</p>
|
|
453
|
-
<p >{BuildData['totalScreenshots']}</p>
|
|
454
|
-
</div>
|
|
455
|
-
<div className={`flex p-1 rounded`}>
|
|
456
|
-
<p className="text-start flex-1 capitalize">Unreviewed Screenshots</p>
|
|
457
|
-
<p >{BuildData['unreviewedSnapshots']}</p>
|
|
458
|
-
</div>
|
|
459
451
|
</div>
|
|
460
452
|
</div>
|
|
461
453
|
<div id="thumbnails" className="p-2">
|