Giter VIP home page Giter VIP logo

docs's Introduction

Nielsen Guidelines, Best Practices & and Tech Docs

Welcome! 👋

In this repository we hope to share with the open source community guidelines, best practices, and technical documentation that we follow and work on in Nielsen.

Table Of Contents

JavaScript

General

docs's People

Contributors

einatnielsen avatar liadshirannielsen avatar lidoravitan avatar lirantal avatar marianna-exelate avatar matanbobi avatar matanborenkraoutnielsen avatar sarvenazl avatar yaronglp 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Meeting 2019-10-10

Agenda

  • Create our roadmap.
  • Make a decision: Enzyme vs React Testing Library. #3

Actions

  • Act - https://reactjs.org/docs/testing-recipes.html - Make a research about ACT pattern in context to react and RTL. Obviously, go through the whole testing recipes.
  • Snapshots - Do we want to recommend using snapshots?
  • Create 3 types of tests So we can compare RTL and Enzyme well. ( Container, FnComponent, ClassComponent).

Meeting 2020-03-26

These are the issues we raised during this meeting:

  • Think about adding backend orientation to the style guide
  • Talk about BDD in the basic rules (how we write assertions)
  • Opinion about snapshots
  • Talk about TDD or just mention it
  • Visual testing
  • What do we say about coverage
  • Should we talk about linters?
  • We're talking very shortly about E2E
  • Act in React and async side effects shouldn't be in the basic rules imo
  • Should we test selectors, reducers?
  • The E2E diagram should be revisited for UX manners.
  • There's missing information about E2E, why we do it and how
  • In the bad examples - Add comments inside the code
  • What are our thoughts about getByText? (Translation related)

Participants:
@lidoravitan @einatnielsen @liadShiranNielsen @MatanBorenkraoutNielsen

Using snapshot testing with Jest - Pros and Cons

Cons:

  • Failures are hard to understand (It’s often hard to see what changed by looking at the snapshot failure diff)
  • We tend to update snapshots without thinking
  • Easy to commit snapshots with bugs (since we usually don’t read these files carefully)
  • Coupling with low level modules (if you don’t use shallow rendering)
  • A false sense of security (Snapshots offer no guarantees that component appearance or behavior is correct)
  • FB recommends using more specific assertions than using snapshots here

Meeting 2019-11-07

Agenda

  • Talk about data attributes - Explanation here

  • Snapshots - Nik will show an example explaining his approach to snapshots

  • AAA - Update on current progress - Issue

  • Class component - Update on current progress

  • Page Object Pattern

Meeting 2019-10-22

Agenda

  • https://reactjs.org/docs/testing-recipes.html - make a research about Act pattern in context to React and RTL. Obviously, go through the testing recipes.

  • Snapshots - Do we want to encourage using snapshots? #6

  • POC - FnComponent, ClassComponent and Redux Connected Component with RTL.

    • Functional Component - Gist
    • Class Component - Gist
    • Redux Connected Component - Gist

Add example with internationalization

internationalization and localization are means of adapting application to different languages. in context to front-end development it could be internal implementation or 3rd party package. However, In terms of testing we want to explain what're the guidelines to test i18n case.

usually i18n implementation is key/value map for each language, which means inside components we use keys to render reach static text instead of write the actual text. for example:

without i18n:<div>hello world </div>
with I18n: <div>formatMessage('examples.hello.world')</div>

References
https://testing-library.com/docs/example-react-intl

AAA In testing

This issue is related to the Arrange - Act - Assert principal and especially in React using the act function

Meeting 2019-10-02

Agenda

Make a decision about our Repo responsibilities.

Actions

Make a research for Enzyme vs React Testing Library.

Enzyme vs React Testing Library

The purpose of this issue is to review the pros and cons between Enzyme and React Testing Library.

  • For the purpose of this discussion we will refer to React Testing Library as RTL.

RTL Pros:

  1. RTL is built on top of react-dom and react-dom/test-utils, thus supports new React features out of the box
  2. RTL approach is testing user behaviour which leads you to be more confident in your tests
  3. RTL limits the way you can interact with elements, and thus forces you to write code that is a11y compliant (best practice).
  4. FB recommend using RTL

Enzyme Cons:

  1. Enzyme is built on top of a custom 'react-dom', thus supporting React new features will not be out of the box
  2. Enzyme unit testing makes you lean towards testing implementation details (state and props) which your user does not care.
  3. Enzyme encourage using ID and css selector, by that your tests are likely to break when you refactor.

hook testing should be best practice for SHARED hooks

currently, we say that hook testing is not preferred but component testing should test it along the way instead. this is true for an internal hook for the sake of the component.

however, when the hook is to be shared across components, it should be tested in isolation as a standalone hook and it is the best practice

Add E2E section and Page Object pattern explanation

We need to cover e2e testing approaches in the style guide.

The explanation should mainly be about how we use the Page Object pattern to interact with the tested page and include code examples of a test that uses a Page Object.
In addition, we need to explain concepts like flows and selectors and how they fit into the e2e testing approach.

The examples should show how we use cypress for e2e tests.

Meeting 2019-12-22

Agenda

Round Table
we want to involve the group with the testing style guide initiative. First, we want to share our knowledge with the group. second, we want to encourage the group to contribute.

actions

  1. determine the responsibilities and goals for this repo in our group.
  2. pick a date :).
  3. create a presentation.

Add section about snapshots testing

We already know agree snapshot testing are totally ok. however, there are only few cases we want to encourage them. let's add extensive exploration about snapshot testing. #34

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.