Skip to content
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

Merged
merged 6 commits into from
Jul 12, 2020

Conversation

wildergd
Copy link
Collaborator

@wildergd wildergd commented Jul 7, 2020

fix: #1641

Changes proposed in this PR:

@nexxtway/react-rainbow

@commit-lint
Copy link

commit-lint bot commented Jul 7, 2020

Tests

  • add unit tests to MarkdownOutput component (35da904)
  • fix tests (6512109)

Contributors

@wildergd, @TahimiLeonBravo

Commit-Lint commands

You can trigger Commit-Lint actions by commenting on this PR:

  • @Commit-Lint merge patch will merge dependabot PR on "patch" versions (X.X.Y - Y change)
  • @Commit-Lint merge minor will merge dependabot PR on "minor" versions (X.Y.Y - Y change)
  • @Commit-Lint merge major will merge dependabot PR on "major" versions (Y.Y.Y - Y change)
  • @Commit-Lint merge disable will desactivate merge dependabot PR
  • @Commit-Lint review will approve dependabot PR
  • @Commit-Lint stop review will stop approve dependabot PR

/<h5 class="(.*)">This is a level 5 header<\/h5>/,
/<h6 class="(.*)">This is a level 6 header<\/h6>/,
];
values.forEach((value, index) => {
Copy link

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) => {
Copy link

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) => {
Copy link

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) => {
Copy link

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', () => {
Copy link

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.

@wildergd wildergd requested a review from maxxgreene July 12, 2020 14:02
expect(ReactDOMServer.renderToString(result.current)).toMatch(patterns[index]);
});
});
it('should return valid html for links', () => {
Copy link

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.

@codeclimate
Copy link

codeclimate bot commented Jul 12, 2020

Code Climate has analyzed commit 0b4006e and detected 6 issues on this pull request.

Here's the issue category breakdown:

Category Count
Duplication 6

View more on Code Climate.

@LeandroTorresSicilia LeandroTorresSicilia merged commit b10b0c2 into master Jul 12, 2020
@LeandroTorresSicilia LeandroTorresSicilia deleted the test-markdownoutput-component branch July 12, 2020 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: implement MarkdownOutput component
4 participants