GithubHelp home page GithubHelp logo

math4you-fe's Introduction

math4you: Practicing POST Requests

This application is almost complete! It is your job to add in the necessary network request so the app works as expected. You will also test this network request using Cypress. Follow the steps below carefully.

screenshot of math4you

Set Up

  1. Clone down this repo and cd into the directory
  2. Run npm i
  3. Run npm start
  4. Clone down the backend repo and cd into that directory
  5. Run npm i
  6. Run node server.js
  7. Spend some time reading through both codebases and clicking around the app (Note: There IS a bug in the app! This is what you are in charge of fixing!)

Writing the POST

  1. Go to the apiCalls.js file in the FE repo
  2. Complete the function by following the steps outlined (Note: When you're done, the app should work with NO bugs!)

Testing the POST - optional 🌢 challenge

  1. Install Cypress into your FE repo
  2. Write a Cypress test that intercepts the POST request and tests the user flow: If a user gets the answer correct, the card should be replaced with a new card
  3. Write a Cypress test that intercepts the POST request and tests the user flow: If a user gets the answer wrong, the card should NOT be replaced with a new card
  4. (optional 🌢🌢 challenge) Write a sad path Cypress test that intercepts the POST request and stubs a response with a 500 status code. What should appear on the page if there is an error (hint: look at MatchCard.js)? Test that it renders as expected!

Stuck? Reference the Writing tests involving network requests section of this lesson

math4you-fe's People

Contributors

kaylagordon avatar niksseif avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.