Created by: tannakartikey
Description of PR
The spec gets the data from https://api.covid19india.org/state_district_wise.json and check if each state and district received from the API exist within the public/maps
file or not.
We need this spec because each day we are getting new places added to the patients' database and hence the API. If any of the upcoming places is missing in the maps data then this spec will start failing. And it is very likely that the place is missing or spelled wrong. It's hard to get the latest data of India in geo objects.
I am going to comment on PR explaining the output of each function shortly after creating the PR.
The spec is added here instead of API because the map is rendered from the public/maps
folder and that data is not available in the API repository.
P.S. Special thanks to @guneetnarula and his friends for real hard work and keep the data updated. Geo objects repo: https://github.com/guneetnarula/indian-district-boundaries.
Note: The spec will fail early on the first mismatch. With Jest, for our case, it is not possible to make the test fail after checking everything without storing the response of the API in a file first. It will make the test static and useless because we will have to update the data manually. Related Jest thread: https://github.com/facebook/jest/issues/1619
Type of PR
-
Bugfix -
New feature
Relevant Issues
#355 (closed)
Checklist
-
Compiles and passes lint tests -
Properly formatted -
Tested on desktop -
Tested on phone
Screenshots