Skip to content

Commit 42250b4

Browse files
diffImage no longer shown if there isn't one
1 parent bcc3d79 commit 42250b4

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

templates/report.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ <h3>{{name}}</h3>
4949
{{/if}}
5050
<div class="diff-images">
5151
<a href="{{baselineImage}}"><img src="{{baselineImage}}" alt="Baseline screenshot for {{name}}" /></a>
52+
{{#unless dimensionMismatch}}
5253
<a href="{{diffImage}}"><img src="{{diffImage}}" alt="Visual difference highlighting changed pixels in {{name}}"/></a>
54+
{{/unless}}
5355
<a href="{{candidateImage}}"><img src="{{candidateImage}}" alt="Candidate screenshot for {{name}}" /></a>
5456
</div>
5557
</div>

test/report-generator.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ describe('report-generator', () => {
9494
expect(html).toContain('Dimension mismatch');
9595
expect(html).toContain('10x20');
9696
expect(html).toContain('20x30');
97+
expect(html).toContain('mismatched-baseline.png');
98+
expect(html).not.toContain('mismatched-diff.png');
99+
expect(html).toContain('mismatched-candidate.png');
97100
});
98101

99102
it('should show status indicator', () => {

0 commit comments

Comments
 (0)