Skip to content

Commit

Permalink
pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yasser Elsayed committed Mar 4, 2019
1 parent 42f3fa8 commit 9090b5b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 28 deletions.
13 changes: 7 additions & 6 deletions frontend/src/components/viewers/MarkdownViewer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ describe('MarkdownViewer', () => {
let tree: ReactWrapper<any> | null;

afterEach(() => {
if (tree) {
tree.unmount();
tree = null;
if (!tree) {
return;
}
tree.unmount();
tree = null;
});

it('does not break on empty data', () => {
Expand All @@ -47,9 +48,9 @@ describe('MarkdownViewer', () => {

it('sanitizes the markdown to remove XSS', () => {
const markdown = `
lower[click me](javascript&#x3a;...)lower
upper[click me](javascript&#X3a;...)upper
`;
lower[click me](javascript&#x3a;...)lower
upper[click me](javascript&#X3a;...)upper
`;
const config: MarkdownViewerConfig = {
markdownContent: markdown,
type: PlotType.MARKDOWN,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ exports[`MarkdownViewer sanitizes the markdown to remove XSS 1`] = `
Array [
Object {
"markdownContent": "
lower[click me](javascript&#x3a;...)lower
upper[click me](javascript&#X3a;...)upper
",
lower[click me](javascript&#x3a;...)lower
upper[click me](javascript&#X3a;...)upper
",
"type": "markdown",
},
]
Expand All @@ -47,8 +47,9 @@ exports[`MarkdownViewer sanitizes the markdown to remove XSS 1`] = `
<div
dangerouslySetInnerHTML={
Object {
"__html": "<p>lower[click me](javascript:...)lower
upper[click me](javascript:...)upper</p>
"__html": "<pre><code> lower[click me](javascript&amp;#x3a;...)lower
upper[click me](javascript&amp;#X3a;...)upper
</code></pre>
",
}
}
Expand Down
17 changes: 0 additions & 17 deletions package-lock.json

This file was deleted.

0 comments on commit 9090b5b

Please sign in to comment.