Code Monkey home page Code Monkey logo

react-test-a24's Introduction

Textual Answers

-react focused test

  1. Nullish operator (??), beacuse it makes my code safer (less breaking).
  2. I have used it to provide default values for undefined/null values in my code.
  3. Besides shorter syntax, arrow functions do not have an arguments object like traditional functions do, so you will need to list arguments.
  4. The order of execution is different. First one the result of foo++ is parsed to the function and function is executed, next one the function recieves the value foo and then function is executed and an incement on foo will happen.
  5. A function defines independent units of logic while classes create a blueprint for creating objects with properties and methods.

CSS

  1. This is what dertemines which style is to be applied first to an element with many styles for example an ID has higher specificity so it will be applied first before a class.
  2. !important gives higher priority in css styles and you would use this when trying to override a style and might cause unexpected behaviours when using it with css libraries.
  3. I prefer using grid because it's easy to layout my rows and columns and place containers neatly on the users screen.
  4. They are legal, it pulls targeted element out of the holding container.
  5. The way the box model works is that all margins do not take up space if not specified, so when a margin is specified for the child element it affects the parent
    . One way to prevent this is to set the overflow to hidden to contain child elements margins.

UNIT TESTS

  1. I have used the React testing library
  2. Yes there were some pitfalls like not using meaningful queries as I often find myself using querues that are not specific enough.
  3. When using RTL i can create a test that uses the query getBy queries (getByLabelText, getByTestId .etc) to find the child component and check the props it consumed.

react-test-a24's People

Contributors

loktioncode avatar

Stargazers

Mateo Lafalce avatar

Watchers

James Cloos 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.