-
-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add unit tests to MarkdownOutput
component
#1690
Conversation
TestsContributorsCommit-Lint commandsYou can trigger Commit-Lint actions by commenting on this PR:
|
src/components/MarkdownOutput/hooks/__test__/useMarkdownToReact.spec.js
Outdated
Show resolved
Hide resolved
/<h5 class="(.*)">This is a level 5 header<\/h5>/, | ||
/<h6 class="(.*)">This is a level 6 header<\/h6>/, | ||
]; | ||
values.forEach((value, index) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 4 locations. Consider refactoring.
/<ol class="(.*)">\n<li class="(.*)">Item #1<\/li>\n<li class="(.*)">Item #2<\/li>\n<li class="(.*)">Item #3<\/li>\n<\/ol>/, | ||
/<ul class="(.*)">\n<li class="(.*)"><input type="checkbox" checked="" disabled=""\/>(.*)Item #1<\/li>\n<li class="(.*)"><input type="checkbox" disabled=""\/>(.*)Item #2<\/li>\n<li class="(.*)"><input type="checkbox" disabled=""\/>(.*)Item #3<\/li>\n<\/ul>/, | ||
]; | ||
values.forEach((value, index) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 4 locations. Consider refactoring.
/<pre[^>]*><code[^>]*>([^<]*)<\/code><\/pre>/, | ||
/<code\s[^>]*>doSomenthing<\/code>/, | ||
]; | ||
values.forEach((value, index) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 4 locations. Consider refactoring.
/<table[^>]*><thead[^>]*><tr[^>]*><td style="text-align:right"[^>]*>Header<\/td><\/tr><\/thead><tbody[^>]*><tr[^>]*><td style="text-align:right"[^>]*>Cell<\/td><\/tr><\/tbody><\/table>/, | ||
/<table[^>]*><thead[^>]*><tr[^>]*><td style="text-align:center"[^>]*>Header<\/td><\/tr><\/thead><tbody[^>]*><tr[^>]*><td style="text-align:center"[^>]*>Cell<\/td><\/tr><\/tbody><\/table>/, | ||
]; | ||
values.forEach((value, index) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Identical blocks of code found in 4 locations. Consider refactoring.
expect(ReactDOMServer.renderToString(result.current)).toMatch(patterns[index]); | ||
}); | ||
}); | ||
it('should return valid html for paragraphs', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
expect(ReactDOMServer.renderToString(result.current)).toMatch(patterns[index]); | ||
}); | ||
}); | ||
it('should return valid html for links', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
Code Climate has analyzed commit 0b4006e and detected 6 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
fix: #1641
Changes proposed in this PR:
add unit tests to
MarkdownOutput
componentI have followed (at least) the PR section of the contributing guide.
@nexxtway/react-rainbow