Giter VIP home page Giter VIP logo

react-challenge's Introduction

Membean React Code Test

Setup:

To get started you'll need to clone this repository:

git clone [email protected]:membean/react-challenge.git
cd react-challenge

Install dependencies:

yarn

To run the app:

yarn start

To run the tests:

yarn test

Objective:

The objective is to make a (mock) API call to get JSON data, which is an array of SVG elements. After stashing that data in Redux, we want you to display the SVGs so that when you hover or click on each SVG, it will render the hex color code as text instead of the the SVG. As a bonus, we'd like you to randomize the color of every SVG so that on each page reload the colors of every React logo changes.

For example, your finished product might look something like the following (but doesn't have to... don't let use stifle your creativity!).

example

Instructions:

  • fetch() is mocked on the window. You can use it exactly as you would use fetch() normally, except that you do not need to call .json() on the response. We return the response body by default.
  • Look at /src/api/mockFetch.js to see the JSON data that is returned.
  1. Your API call should be made using the provided Redux API Middleware file at /src/store/apiMiddleware.js.
  2. Returned data should be stashed in the Redux store (obviously).
  3. Wire up the App.js component to read data from the Redux store and display the SVGs.
  4. Add either a hover or click event to display hex color codes instead of the SVG.

Testing:

Please stick to using the built in Jest/Enzyme test tools for all your unit tests. We'd like to see the following things tested:

  1. Write unit tests for the apiMiddleware.
  2. Write unit tests for the rootReducer.
  3. Write as many unit tests as you think are necessary for the code you write in the App component.

Submission:

Once you are finished, please push your cloned repo to your Github account (i.e. https://github.com/YOUR_USERNAME/react-challenge) and email the URL to us at [email protected].

react-challenge's People

Contributors

bgetting avatar brantstuns avatar

Watchers

 avatar  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.