GithubHelp home page GithubHelp logo

levi-s2 / react-tdd-testing-user-events-lab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from learn-co-curriculum/react-tdd-testing-user-events-lab

0.0 0.0 0.0 285 KB

License: Other

JavaScript 75.62% CSS 1.17% HTML 23.21%

react-tdd-testing-user-events-lab's Introduction

Testing User Events Lab

Learning Goals

  • Use test-driven development to create a form and test form events

Introduction

In this lab, you will build on the portfolio site you created earlier in this section to get some practice at testing user events in React. You'll be responsible for writing tests as well as implementing the described functionality. You can check your work against the solution branch once you're finished.

Instructions

The requirement for this lab is to add a newsletter signup form to your portfolio page. The form should include:

  • a text input for the user's name
  • a text input for the user's email address
  • a set of checkboxes allowing the user to select their interests
  • a button to submit the form

When the form is submitted, use the form data to display a personalized message indicating that the form was submitted successfully.

Bonus: Include a list of the user's interests in the message as well.

You will be doing your coding in src/App.js and src/__tests__/App.test.js. Note that the App.test.js file includes the tests for the existing code for your reference. You will be responsible for creating the additional tests for the form and its behavior. We've provided descriptions of what kind of functionality to test, but you'll need write the actual tests.

The Process

Recall that, when testing user events, your tests should:

  • verify that the initial state of the page is what you want
  • simulate a user event (e.g., typing in a text box)
  • verify that the state of the page updates as expected

Be sure to follow the test-driven development process in creating your tests and code. Specifically, for each feature of your app, you should:

  • identify the desired element or behavior
  • write the tests to check for that element or behavior
  • write the code to make the tests pass

Remember also to use accessible queries as much as possible.

Resources

react-tdd-testing-user-events-lab's People

Contributors

lizbur10 avatar alveem avatar levi-s2 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.