Open
Conversation
Run npm test in js/ directory. Right now the tests get the same Map object, because the require() always returns a reference to the same object, even though it is called once per test. This is undesirable because it could cause confusing interdependencies between tests.
- Add a new mock element in the dom for the year selector - Modify mock data to reflect the new data format
I want to be able to isolate the map class to test it. The changes here are: - Move the const mapping of data keys to user-facing strings inside a map class function. This also avoids needing to worry about updating the previously cached Map.populationKey and map.groupKey values (now it is updated on demand) - Pass in the year selector to the Map class
- Modify index.js to export the Map class rather than an instance of the Map class - Modify index.html to instantiate a Map now that index.js does not
- Style of district data that does not exist returns stripes - Style of district that is missing data returns stripes - Popup of district with higher count than population shows error
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.
I'm so sorry for the delay in sending this pr. I am planning on writing some more tests this afternoon but thought I'd better send an initial pr over now to hold myself accountable :)
I should have some time to make edits so please feel free to share any feedback.
cc @mscarey