test: uts for areaChart, barChart, sparkAreaChart, Legend #1065
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)
Does this PR introduce a breaking change? (check one)
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:
main
branch