Add tests for ResultsPanel selectors (100% coverage for all selectors)#231
Merged
Add tests for ResultsPanel selectors (100% coverage for all selectors)#231
Conversation
jest coverage report 🧪Total coverage
Show new covered files 🌑Coverage of new files
|
schoinh
commented
Aug 10, 2021
| export const getPlotDataConfiguredForPlotly = createSelector( | ||
| [getPlotData], | ||
| (plotData: RawPlotParams[]): PlotConfig[] => { | ||
| if (!plotData) return []; |
Contributor
Author
There was a problem hiding this comment.
This is duplicate logic so I removed it. TypeScript wouldn't allow a null or undefined or other falsy value to be passed in as plotData. And if plotData were an empty array, the map function below would just return an empty array anyway.
meganrm
approved these changes
Aug 10, 2021
ghost
approved these changes
Aug 11, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Resolves #182
This is the last PR for the above issue! After this is merged, all selectors in simularium-website will be 100% covered.
Solution
Added tests to the
ResultsPanelcontainer's selector and its helper functions, breaking down the functions further to make them more easily testable on the way.Type of change
Please delete options that are not relevant.
Steps to Verify:
npm start, load some models with plots (like endocytosis) and make sure the plots look formatted the same way as before.Keyfiles (delete if not relevant):
configureLayouthelper function into smaller functions to make them more easily testable; turned some style values into constants