Coder Social home page Coder Social logo

part2-notes's People

Contributors

mluukkai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

part2-notes's Issues

Not working when I tried to clone it.

I tried cloning the branch and running npm install but notes do not save and I can't follow the training unless I do the entire react portion from scratch. Would like to get started from this branch.

Part 5 - The components children, aka. props.children

The fragment code present in src/App.js:

{user &&
        <div>
          <p>{user.name} logged in</p>
          <Togglable buttonLabel="new note">
            <NoteForm createNote={addNote} />
          </Togglable>
        </div>
      }

According to the material present in Part 5 - letter b - The components children, aka. props.children, should be:

{user &&
        <div>
          <p>{user.name} logged in</p>
<Togglable buttonLabel="new note">
  <NoteForm
    onSubmit={addNote}
    value={newNote}
    handleChange={handleNoteChange}
  />
</Togglable>
        </div>
      }

Greetings and thanks for the incredible course!

Danilo

Package.json scripts added to frontend instead of backend

The following lines have been added to the frontend package.json:

    "build:ui": "rm -rf build && cd ../part2-notes/ && npm run build && cp -r build ../notes-backend",
    "deploy": "git push heroku main",
    "deploy:full": "npm run build:ui && git add . && git commit -m uibuild && git push && npm run deploy",    
    "logs:prod": "heroku logs --tail"

I believe they should have been added to the backend package.json instead.

part3-1. Scripts added to package.json on the frontend.

The material says we should add the following scripts to package.json on the backend:

    "build:ui": "rm -rf build && cd ../part2-notes/ && npm run build && cp -r build ../notes-backend",
    "deploy": "git push heroku main",
    "deploy:full": "npm run build:ui && git add . && git commit -m uibuild && git push && npm run deploy",    
    "logs:prod": "heroku logs --tail"

They were added to the frontend package.json instead.

some part5 component tests appear to fail

npm --version
# Output
8.19.2
cat /etc/*release | grep PRETTY
# Output
PRETTY_NAME="Alpine Linux v3.17"
git clone https://github.com/fullstack-hy2020/part2-notes
cd part2-notes
git checkout part5-11
git rev-parse part5-11
# Output
44cb418875db7f41d7690f8cd99cd5d4c91d56fa
npm ci
CI=true npm run test -- --passWithNoTests

Output:

> [email protected] test
> react-scripts test --passWithNoTests

FAIL src/components/NoteForm.test.js
  ● <NoteForm /> updates parent state and calls onSubmit

    expect(received).toHaveLength(expected)

    Expected length: 1
    Received length: 0
    Received array:  []

      16 |   userEvent.click(sendButton)
      17 |
    > 18 |   expect(createNote.mock.calls).toHaveLength(1)
         |                                 ^
      19 |   expect(createNote.mock.calls[0][0].content).toBe('testing a form...' )
      20 | })

      at Object.toHaveLength (src/components/NoteForm.test.js:18:33)

FAIL src/components/Note.test.js
  ● clicking the button calls event handler once

    expect(received).toHaveLength(expected)

    Expected length: 1
    Received length: 0
    Received array:  []

      33 |   userEvent.click(button)
      34 |
    > 35 |   expect(mockHandler.mock.calls).toHaveLength(1)
         |                                  ^
      36 | })

      at Object.toHaveLength (src/components/Note.test.js:35:34)

FAIL src/components/Togglable.test.js
  ● <Togglable /> › after clicking the button, children are displayed

    expect(element).not.toHaveStyle()

    Compared values have no visual difference.

      32 |
      33 |     const div = container.querySelector('.togglableContent')
    > 34 |     expect(div).not.toHaveStyle('display: none')
         |                     ^
      35 |   })
      36 |
      37 |   test('toggled content can be closed', () => {

      at Object.toHaveStyle (src/components/Togglable.test.js:34:21)

Test Suites: 3 failed, 3 total
Tests:       3 failed, 4 passed, 7 total
Snapshots:   0 total
Time:        4.167 s
Ran all test suites.

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.