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: uts for areaChart, barChart, sparkAreaChart, Legend #1065

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Wajahat5
Copy link

@Wajahat5 Wajahat5 commented May 26, 2024

Description
Added new UTs for areaChart, barChart, sparkAreaChart, Legend components, and increased their coverage.

Added new files AreaChart.test.tsx, BarChart.test.tsx, SparkAreaChart.test.tsx and used existing file Legend.test.tsx to write UTs for areaChart, barChart, sparkAreaChart, Legend components.

Earlier the coverage for the said components looked like this:
All files | 49.66 | 22.91 | 35.94 | 50.76
AreaChart.tsx | 4 | 0 | 0 | 4.16 |
BarChart.tsx | 6 | 0 | 0 | 6.25 |
SparkAreaChart.tsx | 25 | 0 | 0 | 25 |
Legend.tsx | 35.29 | 23.88 | 28 | 35.36 |
Test Suites: 34 passed, 34 total
Tests: 45 passed, 45 total

After adding new tests, it looks like this:
File | % Stmts | % Branch | % Funcs | % Lines |
All files | 52.99 | 31.31 | 39.74 | 54.24
AreaChart.tsx | 28 | 43.08 | 20 | 29.16 |
BarChart.tsx | 28 | 42.2 | 16.66 | 29.16
SparkAreaChart.tsx | 100 | 72.72 | 100 | 100 |
Legend.tsx | 47.05 | 35.82 | 36 | 47.56 |
Test Suites: 37 passed, 37 total
Tests: 62 passed, 62 total

Related issue(s)
#1064

What kind of change does this PR introduce? (check at least one)

  • Bug fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • New Feature (BREAKING CHANGE which adds functionality)
  • Refactor
  • Build-related changes
  • Other, please describe:
  • unit test cases for areaChart, barChart, sparkAreaChart, Legend components.

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

How has this been tested?
By executing npm run tests -- --coverage --watchAll to get a report on the new ut coverage.
The changes does not effect other parts of the code as it only adds new tests.

The PR fulfils these requirements:

  • It's submitted to the main branch
  • When resolving a specific issue, it's referenced in the related issue section above
  • My change requires a change to the documentation. (Managed by Tremor Team)
  • I have added tests to cover my changes
  • Check the "Allow edits from maintainers" option while creating your PR.
  • Add refs #XXX or fixes #XXX to the related issue section if your PR refers to or fixes an issue.
  • By contributing to Tremor, you confirm that you have read and agreed to Tremor's CONTRIBUTING.md guideline. You also agree that your contributions will be licensed under the Apache License 2.0 license.

Copy link

vercel bot commented May 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tremor-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 26, 2024 7:21pm

@Wajahat5 Wajahat5 changed the title #1064 uts for areaChart, barChart, sparkAreaChart, Legend test: uts for areaChart, barChart, sparkAreaChart, Legend May 26, 2024
@severinlandolt severinlandolt added Status: Review needed The issue/feature should be reviewed Type: Refactor Restructuring or improving existing code Type: Test Indicates that tests are affected. labels May 29, 2024
@severinlandolt
Copy link
Member

Nice! Will have a look at it in the next minor release 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review needed The issue/feature should be reviewed Type: Refactor Restructuring or improving existing code Type: Test Indicates that tests are affected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants