Giter Site home page Giter Site logo

gostack-template-reactjs-crud's Introduction

Rocketseat Education

Rocketseat Project License

💻 Projeto

gostack-template-reactjs-crud

📝 Licença

Esse projeto está sob a licença MIT. Veja o arquivo LICENSE para mais detalhes.


Feito com 💜 by Rocketseat



banner

gostack-template-reactjs-crud's People

Contributors

daltonmenezes avatar josepholiveira avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gostack-template-reactjs-crud's Issues

Warnings on test file

Variable debug is unused;

const { getByText, getByTestId, getByPlaceholderText, >debug< } = render(
      <Dashboard />,
    );

Some others variables referencing a property that doesn't exists on HTMLElement.

const inputImage = getByPlaceholderText('Cole o link aqui');
expect(inputImage.>value<).toBe('http://rocketseat.com.br');

Update availability test missing api check

The following code at Food/index.ts would make the test pass:

async function toggleAvailable(): Promise<void> {
  setIsAvailable(!isAvailable)
}

But if you reload the page, the state is not maintained because there isn't any api call to update food availability.

Doubt about use put/patch to update available status according obtained test results

At the begining of the bootcamp, Diego has been reinforce the difference between this two methods and its applications. For me, in this case PATCH makes much more sense than PUT because I'm changing only the "available" attribute of the food resource, not all the resource.

But if you try to use PATCH to toggle the available status, the tests will return error 404, otherwise if you goes to use PUT, everthing will be ok and the test will return success.

According Mozilla.org:
The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload. (https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT)

The HTTP PATCH request method applies partial modifications to a resource. https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PATCH

There is a reason to use PUT in this case?

Regards.

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.