Skip to content

Commit d9aac78

Browse files
committed
update readme with a step for writing tests
1 parent 3ea6b8d commit d9aac78

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,29 @@ This way you go about completing these goals is meant to be open-ended, so tackl
5353

5454
In `map/serializers.py`, supplement each community area with data on the amount of permits issued in each area during the currently filtered year. From here, the view will pass that data to the front end.
5555

56-
### Step 2: Filter results by a specific year
56+
### Step 2: Write a test for your data endpoint
57+
58+
In `tests/test_views.py` implement a test to validate the data that your endpoint produces. You will want to create some test `CommunityArea` and `RestaurantPermit` objects and then assert that the expected values are returned when querying the endpoint.
59+
60+
Use this command to run tests:
61+
62+
```bash
63+
docker compose -f docker-compose.yml -f tests/docker-compose.yml run --rm app
64+
```
65+
66+
### Step 3: Filter results by a specific year
5767

5868
In `map/static/js/RestaurantPermitMap.js`, create a filter that allows users to send a request for a specific year to the backend. The options shoulds be any year between 2016 and 2026, inclusive. Then, use the fetch api in the map component to make a request and receive that data.
5969

60-
### Step 3: Display results on the page
70+
### Step 4: Display results on the page
6171

6272
In the map component, process the community area and use it to display shapes for all areas on the map. Then, display the total number of restaurant permits that year as well as the maximum number of permits in any one area.
6373

64-
### Step 4: Make the map dynamic
74+
### Step 5: Make the map dynamic
6575

6676
Start displaying some data! Use the `setAreaInteraction()` method to shade the map according to how many permits it has in a year, making sure that it updates automatically when a new year is selected. In this same method, have each area display a popup during some kind of user interaction. The popup should have some light details to help the user understand what they're looking at.
6777

68-
### Step 5: Submit your work
78+
### Step 6: Submit your work
6979

7080
To submit your work, create a feature branch for your code, commit your changes, push your commits up to your fork, and open up a pull request against main. Finally, drop a link to your pull request in your application.
7181

0 commit comments

Comments
 (0)