Skip to content

Commit

Permalink
No monospace in diff
Browse files Browse the repository at this point in the history
  • Loading branch information
yury-s committed Oct 10, 2024
1 parent 6fbd199 commit d0b52e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
7 changes: 5 additions & 2 deletions packages/html-reporter/src/testErrorView.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
limitations under the License.
*/

.test-error-message {
.test-error-view {
white-space: pre;
font-family: monospace;
overflow: auto;
flex: none;
padding: 0;
Expand All @@ -26,3 +25,7 @@
line-height: initial;
margin-bottom: 6px;
}

.test-error-text {
font-family: monospace;
}
10 changes: 5 additions & 5 deletions packages/html-reporter/src/testErrorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const TestErrorView: React.FC<{
error: string;
}> = ({ error }) => {
const html = React.useMemo(() => ansiErrorToHtml(error), [error]);
return <div className='test-error-message' dangerouslySetInnerHTML={{ __html: html || '' }}></div>;
return <div className='test-error-view test-error-text' dangerouslySetInnerHTML={{ __html: html || '' }}></div>;
};

export const TestScreenshotErrorView: React.FC<{
Expand All @@ -34,10 +34,10 @@ export const TestScreenshotErrorView: React.FC<{
}> = ({ errorPrefix, diff, errorSuffix }) => {
const prefixHtml = React.useMemo(() => ansiErrorToHtml(errorPrefix), [errorPrefix]);
const suffixHtml = React.useMemo(() => ansiErrorToHtml(errorSuffix), [errorSuffix]);
return <div data-testid='test-screenshot-error-view' className='test-error-message'>
<div dangerouslySetInnerHTML={{ __html: prefixHtml || '' }}></div>
<ImageDiffView key='image-diff' diff={diff} hideDetails={true} ></ImageDiffView>
<div data-testid='error-suffix' dangerouslySetInnerHTML={{ __html: suffixHtml || '' }}></div>
return <div data-testid='test-screenshot-error-view' className='test-error-view'>
<div dangerouslySetInnerHTML={{ __html: prefixHtml || '' }} className='test-error-text' style={{ marginBottom: 20 }}></div>
<ImageDiffView key='image-diff' diff={diff} hideDetails={true}></ImageDiffView>
<div data-testid='error-suffix' dangerouslySetInnerHTML={{ __html: suffixHtml || '' }} className='test-error-text'></div>
</div>;
};

Expand Down

0 comments on commit d0b52e3

Please sign in to comment.