Skip to content

Commit

Permalink
fix: code trace updates (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
todti authored Jan 16, 2025
1 parent 4098e8b commit a048f77
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 66 deletions.
23 changes: 1 addition & 22 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { sanitizeHtml } from "@allurereport/web-commons";
import { IconButton, TooltipWrapper, allureIcons } from "@allurereport/web-components";
import { Code, Text } from "@allurereport/web-components";
import { Code, IconButton, Text, TooltipWrapper, allureIcons } from "@allurereport/web-components";
import { useState } from "preact/hooks";
import { useI18n } from "@/stores/locale";
import { copyToClipboard } from "@/utils/copyToClipboard";
import * as styles from "./styles.scss";

const TestResultErrorTrace = ({ trace }) => {
const sanitizedTrace = sanitizeHtml(trace);

const TestResultErrorTrace = ({ trace }: { trace: string }) => {
return (
<div data-testid="test-result-error-trace" className={styles["test-result-error-trace"]}>
<Code size={"s"} type={"ui"}>
<pre dangerouslySetInnerHTML={{ __html: sanitizedTrace }} />
<pre>{trace}</pre>
</Code>
</div>
);
Expand Down Expand Up @@ -42,7 +38,7 @@ export const TestResultError = ({ message, trace }) => {
</div>
<div className={styles["test-result-error-message"]} onClick={() => setIsOpen(!isOpen)}>
<Code data-testid="test-result-error-message" size={"s"}>
{message}
<pre>{message}</pre>
</Code>
</div>
{isOpen && trace && <TestResultErrorTrace trace={trace} />}
Expand Down
3 changes: 1 addition & 2 deletions packages/web-commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"clean": "rimraf ./dist"
},
"dependencies": {
"@allurereport/core-api": "workspace:*",
"xss": "^1.0.15"
"@allurereport/core-api": "workspace:*"
},
"devDependencies": {
"@stylistic/eslint-plugin": "^2.6.1",
Expand Down
1 change: 0 additions & 1 deletion packages/web-commons/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export * from "./data.js";
export * from "./static.js";
export * from "./sanitizeHtml.js";
12 changes: 0 additions & 12 deletions packages/web-commons/src/sanitizeHtml.ts

This file was deleted.

22 changes: 1 addition & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,6 @@ __metadata:
tslib: "npm:^2.7.0"
typescript: "npm:^5.6.3"
vitest: "npm:^2.1.8"
xss: "npm:^1.0.15"
languageName: unknown
linkType: soft

Expand Down Expand Up @@ -9459,7 +9458,7 @@ __metadata:
languageName: node
linkType: hard

"commander@npm:^2.20.0, commander@npm:^2.20.3":
"commander@npm:^2.20.0":
version: 2.20.3
resolution: "commander@npm:2.20.3"
checksum: 10/90c5b6898610cd075984c58c4f88418a4fb44af08c1b1415e9854c03171bec31b336b7f3e4cefe33de994b3f12b03c5e2d638da4316df83593b9e82554e7e95b
Expand Down Expand Up @@ -9893,13 +9892,6 @@ __metadata:
languageName: node
linkType: hard

"cssfilter@npm:0.0.10":
version: 0.0.10
resolution: "cssfilter@npm:0.0.10"
checksum: 10/1e45182f42de848f092f50a313113c28a88e4ac98333bf1603ee1c3b200384a3bc83c12e35cd61135e3b0f218295f600d51120ca1f926b7958b2d3262d711214
languageName: node
linkType: hard

"cssnano-preset-default@npm:^5.2.14":
version: 5.2.14
resolution: "cssnano-preset-default@npm:5.2.14"
Expand Down Expand Up @@ -20906,18 +20898,6 @@ __metadata:
languageName: node
linkType: hard

"xss@npm:^1.0.15":
version: 1.0.15
resolution: "xss@npm:1.0.15"
dependencies:
commander: "npm:^2.20.3"
cssfilter: "npm:0.0.10"
bin:
xss: bin/xss
checksum: 10/074ad54babac9dd5107466dbf30d3b871dbedae1f8e7b8f4e3b76d60da8b92bd0f66f18ccd26b8524545444ef784b78c526cee089a907aa904f83c8b8d7958f6
languageName: node
linkType: hard

"yallist@npm:^3.0.2":
version: 3.1.1
resolution: "yallist@npm:3.1.1"
Expand Down

0 comments on commit a048f77

Please sign in to comment.