2020-02-21
1852
#react
Rafael Quintanilha
14261
Feb 21, 2020 â‹… 6 min read

Semantic tests with react-testing-library

Rafael Quintanilha Rafael Quintanilha is a frontend engineer focused on developing intuitive and accessible interfaces with React. You can read Rafael's articles on rafaelquintanilha.com, a blog where he talks about technology, web development, mathematics, and whatever comes to his mind.

Recent posts:

CSS typography in white on a vibrant red geometric background. Article will focus on the CSS backdrop-filter property and its various functions, including blur, grayscale, brightness, and drop-shadow.

How to use the CSS backdrop-filter property

Backdrop and background have similar meanings, as they both refer to the area behind something. The main difference is that […]

Oscar Jite-Orimiono
Oct 4, 2024 â‹… 10 min read
6 AI Tools For API Testing And Development

6 AI tools for API testing and development

AI tools like IBM API Connect and Postbot can streamline writing and executing API tests and guard against AI hallucinations or other complications.

Frank Joseph
Oct 3, 2024 â‹… 12 min read
Patterns For Efficient DOM Manipulation With Vanilla JavaScript

Patterns for efficient DOM manipulation with vanilla JavaScript

Explore DOM manipulation patterns in JavaScript, such as choosing the right querySelector, caching elements, improving event handling, and more.

Joe Attardi
Oct 2, 2024 â‹… 8 min read
Integrating Chrome's New `Window.ai` API In A Vue App

Integrating AI features in Vue using Chrome’s `window.ai` API

`window.ai` integrates AI capabilities directly into the browser for more sophisticated client-side functionality without relying heavily on server-side processing.

Emmanuel John
Oct 1, 2024 â‹… 10 min read
View all posts

One Reply to "Semantic tests with react-testing-library"

  1. Hi,
    Interesting article but I disagree on some aspects, here are 2 cents of mine to be added to the thinking …
    Each story needs to carry ‘acceptance criteria’ on which tests will be based.
    You don’t create your tests solely based on the story description “as a X I need to do Y so that I get Z”, and you don’t rely on the PM blindly deciding which tests are to be executed.
    How do you know 25 = 77 is representative of the test data you need to use to verify your converter result?
    What about 0, what about -1, what about 12.3 (or is it 12,3 that is accepted as valid input), what about 2.345,67 (or 2,345.67) ? How many decimals are required on the visual or during calculation? Do we use rounding or truncation?
    e.g. convert -17.77777 C to F : is that giving 1,4e-5°F as correct result ? or is it 1.399999998e-5 or 0.0000140000000001805 (sample taken from google search converter) ?
    Also you can’t skip implementation from your tests.
    Let’s imagine a developer detects numeric/alphabetic values in code by testing the keyboard key nrs, that is not good because not all keyboards have same layout and we want to test that (yes, I saw this being done by a developer)
    For ‘clear rules’, you’d maybe like to look at techniques such as equivalence partitioning, boundary value analysis, decision tree …

    Philippe.

Leave a Reply