Update packages/html-reporter/src/testResultView.tsx

fair point, I wanted to be conservative in order not to introduce regression but if you say that all video types are supported I'm ok with your suggestion.

Co-authored-by: Dmitry Gozman <dgozman@gmail.com>
Signed-off-by: Remigiusz Dudek <remigiusz_dudek@tlen.pl>
This commit is contained in:
Remigiusz Dudek 2024-10-14 13:08:23 +02:00 committed by GitHub
parent 10955ef6bd
commit 5778201462
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -70,7 +70,7 @@ export const TestResultView: React.FC<{
const { screenshots, videos, traces, otherAttachments, diffs, errors, htmls } = React.useMemo(() => { const { screenshots, videos, traces, otherAttachments, diffs, errors, htmls } = React.useMemo(() => {
const attachments = result?.attachments || []; const attachments = result?.attachments || [];
const screenshots = new Set(attachments.filter(a => a.contentType.startsWith('image/'))); const screenshots = new Set(attachments.filter(a => a.contentType.startsWith('image/')));
const videos = attachments.filter(a => a.contentType === 'video/webm'); const videos = attachments.filter(a => a.contentType.startsWith('video/'));
const traces = attachments.filter(a => a.name === 'trace'); const traces = attachments.filter(a => a.name === 'trace');
const htmls = attachments.filter(a => a.contentType.startsWith('text/html')); const htmls = attachments.filter(a => a.contentType.startsWith('text/html'));
const otherAttachments = new Set<TestAttachment>(attachments); const otherAttachments = new Set<TestAttachment>(attachments);