Skip to content

Commit 86f5179

Browse files
committed
ready
1 parent 0250b98 commit 86f5179

File tree

4 files changed

+902
-896
lines changed

4 files changed

+902
-896
lines changed

README.md

+14-15
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,29 @@ In this challenge, you will write the logic for [THIS WIDGET](https://advanced-r
66

77
Study its functionality and also inspect the Console, the Network tab and the Elements tab **in Chrome Dev Tools**:
88

9-
- There are two versions of the widget, with identical functionality.
9+
- There are two versions of the widget with identical functionality: class-based and functional.
1010
- The input box at the bottom of the page expects a valid email address.
1111
- Email validation errors arrive from the server, as you can see in the Network tab, under "Preview".
1212
- The payload sent to the server on form submit can also be seen in the Network tab, under "Payload".
13+
- One valid email in particular, `[email protected]`, **results in a "Forbidden" server error**
1314
- The origin of coordinates of the grid is on its top-left corner.
14-
- One valid email in particular, `[email protected]`, **results in a "Forbidden" server error**.
1515

1616
## Requirements
1717

1818
### Tools
1919

2020
- Node 16.x
2121
- NPM 8.x (update NPM executing `npm i -g npm`)
22+
- Postman (download [here](https://www.postman.com/downloads/))
2223
- Chrome >= 96.x
2324

24-
Other configurations might work but haven't been tested.
25-
26-
### Optional Tools
27-
28-
- Postman (download [here](https://www.postman.com/downloads/))
25+
Other browser/Node/NPM configurations might work but haven't been tested.
2926

3027
## Project Setup
3128

3229
- Fork, clone, and `npm install`. You won't need to add any extra libraries.
3330
- Launch the project on a development server executing `npm run dev`.
34-
- Visit your widget by navigating to `http://localhost:3000` with Chrome.
31+
- Visit your widget by navigating Chrome to `http://localhost:3000`.
3532
- Run tests locally executing `npm test`. The test file is `codegrade_mvp.test.js`.
3633

3734
## API
@@ -55,7 +52,7 @@ Other configurations might work but haven't been tested.
5552
- The DOM produced by your components must match exactly the DOM in the prototype:
5653
- The hierarchy of HTML elements, their ids, class names etc must be the same.
5754
- The current square is marked with a capital B and an "active" class name.
58-
- Submit success and error messages are those returned by the API (see Network tab, "Preview" area).
55+
- The submit success and error messages that display on the page come from the API (see Network tab).
5956
- No frontend form validation code is required.
6057
- The coordinates of each square of the grid are as follows:
6158

@@ -71,21 +68,23 @@ Other configurations might work but haven't been tested.
7168

7269
### MVP 2, Testing
7370

74-
- Using `codegrade_mvp.test.js` as inspiration, write a few tests inside `frontend/components/App.test.js`:
71+
- Using `codegrade_mvp.test.js` as inspiration, write 5 tests inside `frontend/components/App.test.js`:
7572
- From inside the test file, import a component of your choosing, either `AppClass.js` or `AppFunctional.js`.
76-
- Test that emails over 100 characters long result in a particular server error on the screen.
77-
- Inspect the API with Postman to see what this error actually is.
73+
- Test that the visible texts in headings, buttons, links... render on the screen.
74+
- Test that typing on the input results in its value changing to the entered text.
7875

7976
### Stretch Goals
8077

8178
- Extract some of the stateful logic into a custom hook at the top of `AppFunctional.js`.
82-
- Build a stateless component responsible for rendering the markup in the stateful components, so it does not have to be repeated.
83-
- Do not break your MVP by pushing broken stretch goals. You must keep your tests passing at 100%.
79+
- Build a stateless component responsible for rendering the markup in the stateful components, so this markup does not have to appear twice.
80+
- Do not break your MVP by pushing broken stretch goals. You must keep your tests passing at 100%
8481

8582
### Important Notes
8683

8784
- Design the state of the app before opening your editor. You might need fewer pieces of state than you think!
88-
- Find the simplest data structure that describes effectively the state of the grid.
85+
- Booleans can be represented as 1/0, true/false, "on"/"off". In similar way, many types of data structures could represent the grid.
86+
- Try to find the simplest data structure that describes effectively the state of the grid at any point in time.
87+
- If the state that drives the grid is simple, it will be easier to update it as the user moves around.
8988
- "Product" works hard designing the messages: we must reproduce them faithfully, down to the last comma.
9089
- If you start with Functional, don't switch to Class-Based until Functional is passing all its tests (and vice versa).
9190
- If the direction of the `y` axis surprises you, know that elements in HTML also have their origin of coordinates on their top-left corner.

backend/server.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ server.get('*', (req, res) => {
2323

2424
server.use((req, res) => {
2525
res.status(404).json({
26-
message: `Endpoint [${req.method}] ${req.path} does not exist`,
26+
message: `Endpoint [${req.method}] ${req.originalUrl} does not exist`,
2727
})
2828
})
2929

0 commit comments

Comments
 (0)