Skip to content

Instantly share code, notes, and snippets.

@khalidwilliams
Last active October 22, 2020 15:02
Show Gist options
  • Save khalidwilliams/04da02ba3a945a6e224ab645f227a421 to your computer and use it in GitHub Desktop.
Save khalidwilliams/04da02ba3a945a6e224ab645f227a421 to your computer and use it in GitHub Desktop.

React Weather App

For this exercise, we would like you to make and test a weather app using React, React Testing Library, and the open weather map api.

Spec

  • The app should have a form that takes in a location (city name or zip code, your choice)
  • When the form is submitted, the app should display the current weather for the location
  • When the form is submitted, the app should display a 5 day forcast for the location

Data

You should use the open weather map api for your weather data.

Examples of how to make requests for current weather and a 5 day forecast can be found in their docs

API Credentials

The API is free, but requires an api key.

Testing

For practice, you should test your app as well.

  • Write unit tests for all sub components. These unit tests should:
    • verify that the component renders the UI we expect when passed props
    • verify that any methods the component receives as props are called at the correct times
  • Write integration tests that go over major user stories. These tests should:
    • Verify that the user can fill out the form, submit it, and see the current weather on the DOM
    • Verify that the user can fill out the form, submit it, and see a 5 day forecast appear on the DOM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment