bonham000 / fcc-react-tests-module

The original freeCodeCamp React/Redux alpha curriculum.

Home Page:http://hysterical-amusement.surge.sh/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

/* **************************************************************************************************

________                                             __             .___._.
\______ \   ____ _____________   ____   ____ _____ _/  |_  ____   __| _/| |
 |    |  \_/ __ \\____ \_  __ \_/ __ \_/ ___\\__  \\   __\/ __ \ / __ | | |
 |    `   \  ___/|  |_> >  | \/\  ___/\  \___ / __ \|  | \  ___// /_/ |  \|
/_______  /\___  >   __/|__|    \___  >\___  >____  /__|  \___  >____ |  __
        \/     \/|__|               \/     \/     \/          \/     \/  \/

**************************************************************************************************** */

This is the original project used to develop the React/Redux curriculum for freeCodeCamp. This curriculum has been migrated to freeCodeCamp and will be accessible there from now on. Any issues related to these challenges should be posted in the freeCodeCamp Github. This project is now deprecated and will not be maintained any further. πŸ’£

The original challenges (which require an out of date version of Enzyme), will continue living at their original home.


freeCodeCamp React/Redux Curriculum

This repository contains the code for the Alpha version of the freeCodeCamp React/Redux Curriculum Expansion.

Overview:

  • 50 React Challenges
  • 18 Redux Challenges
  • 10 React-Redux Challenges

Curriculum Map:

  • βœ… Challenge is fully QA'd and ready to ship
  • πŸ“˜ Challenge has been reviewed and is ready for QA

React Challenges:

  • Introducing JSX Elements

    • βœ… πŸ“˜ 1: Create a Simple JSX element
    • βœ… πŸ“˜ 2: Create a Complex JSX Element
    • βœ… πŸ“˜ 3: Add Comments in JSX (may need to revise test for comment)
    • βœ… πŸ“˜ 4: Render HTML Elements to the DOM
    • βœ… πŸ“˜ 5: Define an HTML Class in JSX
    • βœ… πŸ“˜ 6: Learn About Self-Closing JSX Tags
  • Introducing React/Components

    • βœ… πŸ“˜ 7: Create a Stateless Functional Component (introduce ES6 arrow syntax here?)
    • βœ… πŸ“˜ 8: Create a Component with React
    • βœ… πŸ“˜ 9: Create a Component with Composition
    • βœ… πŸ“˜ 10: Use React to Render Nested Components
    • βœ… πŸ“˜ 11: Compose React Components
    • βœ… πŸ“˜ 12: Render a Class Component to the DOM
    • βœ… πŸ“˜ 13: Write a React Component from Scratch
  • Props

    • βœ… πŸ“˜ 14: Pass a String to a Functional Component
    • βœ… πŸ“˜ 15: Pass an Array as Props
    • βœ… πŸ“˜ 16: Use Default Props
    • βœ… πŸ“˜ 17: Override Default Props (cannot check defaultProps on child)
    • βœ… πŸ“˜ 18: Use PropTypes to Define the Props You Expect (regex .includes test for propTypes)
    • βœ… πŸ“˜ 19: Access Props Using this.props
    • βœ… πŸ“˜ 20: Using Props with Stateless Functional Components (regex .includes test for propTypes)
  • State

    • βœ… πŸ“˜ 21: Create a Stateful Component
    • βœ… πŸ“˜ 22: Render State in the UI
    • βœ… πŸ“˜ 23: Render State in the UI Another Way
    • βœ… πŸ“˜ 24: Set State with this.setState
    • βœ… πŸ“˜ 25: Bind 'this' to a Class Method
    • βœ… πŸ“˜ 26: Bind 'this' with an ES6 Arrow Function
    • βœ… πŸ“˜ 27: Use State to Toggle an Element
    • βœ… πŸ“˜ 28: Write a Simple Counter
    • βœ… πŸ“˜ 29: Create a Controlled Input
    • βœ… πŸ“˜ 30: Create a Controlled Form
    • βœ… πŸ“˜ 31: Pass State as Props to Child Components
    • βœ… πŸ“˜ 32: Pass a Callback as Props
  • Component Lifecycle

    • βœ… πŸ“˜ 33: Use the Lifecycle Method componentWillMount
    • βœ… πŸ“˜ 34: Use the Lifecycle Method componentDidMount
    • βœ… πŸ“˜ 35: Add Event Listeners is the explanation correct?
    • βœ… πŸ“˜ 36: Manage Updates with Lifecycle Methods
    • βœ… πŸ“˜ 37: Optimize Re-Renders with shouldComponentUpdate
  • Advanced Rendering

    • βœ… πŸ“˜ 38: Introducing Inline Styles
    • βœ… πŸ“˜ 39: Add Inline Styles in React
    • βœ… πŸ“˜ 40: Use Advanced JavaScript in React Render Method
    • βœ… πŸ“˜ 41: Render with an If/Else Condition
    • βœ… πŸ“˜ 42: Use && for a More Concise Conditional
    • βœ… πŸ“˜ 43: Return null to Prevent Rendering
    • βœ… πŸ“˜ 44: Use a Ternary Expression for Conditional Rendering
    • βœ… πŸ“˜ 45: Render Conditionally from Props
    • βœ… πŸ“˜ 46: Change Inline CSS Conditionally Based on Component State
    • βœ… πŸ“˜ 47: Use Array.map() to Dynamically Render Elements
    • βœ… πŸ“˜ 48: Give Sibling Elements a Unique Key Attribute
    • βœ… πŸ“˜ 49: Use Array.filter() to Dynamically Filter an Array
    • βœ… πŸ“˜ 50: Render React on the Server with renderToString

Redux Challenges:

  • Basic Redux: Store, Actions, & Reducers

    • βœ… πŸ“˜ 1: Create a Redux Store
    • βœ… πŸ“˜ 2: Get the State of the Redux Store
    • βœ… πŸ“˜ 3: Define a Redux Action
    • βœ… πŸ“˜ 4: Define an Action Creator
    • βœ… πŸ“˜ 5: Dispatch an Action Event
    • βœ… πŸ“˜ 6: Handle an Action in the Store
    • βœ… πŸ“˜ 7: Use a Switch Statement to Handle Multiple Actions
    • βœ… πŸ“˜ 8: Use const for Action Types
    • βœ… πŸ“˜ 9: Register a Store Listener
    • βœ… πŸ“˜ 10: Combine Multiple Reducers
    • βœ… πŸ“˜ 11: Send Action Data to the Store
    • βœ… πŸ“˜ 12: Use Middleware to Handle Asynchronous Actions (Async testing... hacked with regex of course)
    • βœ… πŸ“˜ 13: Write a Counter with Redux
  • Enforcing State Immutability

    • βœ… πŸ“˜ 14: Never Mutate State
    • βœ… πŸ“˜ 15: Use the Spread Operator on Arrays
    • βœ… πŸ“˜ 16: Remove an Item from an Array
    • βœ… πŸ“˜ 17: Copy an Object with Object.assign
    • βœ… πŸ“˜ 18: Use the ES6 Spread Operator with Objects

React-Redux Challenges:

  • Use react-redux to Manage a List of Messages

    • βœ… πŸ“˜ 1: Getting Started with React Redux
    • βœ… πŸ“˜ 2: Manage State Locally First
    • βœ… πŸ“˜ 3: Extract State Logic to Redux
    • βœ… πŸ“˜ 4: Use Provider to Connect Redux to React
    • βœ… πŸ“˜ 5: Map State to Props
    • βœ… πŸ“˜ 6: Map Dispatch to Props
    • βœ… πŸ“˜ 7: Connect Redux to React
    • βœ… πŸ“˜ 8: Connect Redux to the Messages App
    • βœ… πŸ“˜ 9: Extract Local State into Redux
    • βœ… πŸ“˜ 10: Moving Forward From Here

To run this project locally, clone the repository, install the dependencies, and run npm start. Now you can view all the finished challenges live in the browser.

This project is running tests against React components, ES6 code, and plain JavaScript which users write directly into an in-browser code editor. To accomplish this we are using the Babel standalone package to transpile JavaScript and the testing library Enzyme to conduct tests. At a basic level the tests we're writing for React components generally look like this:

assert(Enzyme.mount(<App />).type() === 'div', 'The component renders a div element');

This project was bootstrapped with Create React App.


About

The original freeCodeCamp React/Redux alpha curriculum.

http://hysterical-amusement.surge.sh/

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:JavaScript 98.8%Language:CSS 0.8%Language:HTML 0.4%