Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ReactDay 2022 - Unit testing
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Luca Del Puppo
October 19, 2022
Programming
0
120
ReactDay 2022 - Unit testing
Luca Del Puppo
October 19, 2022
Tweet
Share
More Decks by Luca Del Puppo
See All by Luca Del Puppo
Keep alive your typescript definitions using Zod
puppo
0
140
Aware dependencies using Nx Graph
puppo
0
85
Prisma the ORM that node was waiting for
puppo
0
120
How to scale up your projects like a pro
puppo
0
140
Alive, Tipi Sopravvisuti
puppo
0
130
How to scale up your angular projects like a pro
puppo
0
200
Prisma in the Air
puppo
0
430
Can typescript definitions survive even at runtime?
puppo
0
130
Is it possible to build your UI components using only web components?
puppo
0
95
Other Decks in Programming
See All in Programming
Docコメントで始める簡単ガードレール
keisukeikeda
1
110
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.1k
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
460
DevinとClaude Code、SREの現場で使い倒してみた件
karia
1
1k
new(1.26) ← これすき / kamakura.go #8
utgwkk
0
2.3k
2026年は Rust 置き換えが流行る! / 20260220-niigata-5min-tech
girigiribauer
0
230
How to stabilize UI tests using XCTest
akkeylab
0
120
SourceGeneratorのマーカー属性問題について
htkym
0
190
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
180
クライアントワークでSREをするということ。あるいは事業会社におけるSREと同じこと・違うこと
nnaka2992
1
340
ふつうのRubyist、ちいさなデバイス、大きな一年 / Ordinary Rubyists, Tiny Devices, Big Year
chobishiba
1
440
AI時代のシステム設計:ドメインモデルで変更しやすさを守る設計戦略
masuda220
PRO
5
960
Featured
See All Featured
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
140
Prompt Engineering for Job Search
mfonobong
0
180
Paper Plane
katiecoart
PRO
0
48k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
470
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
100
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
199
73k
The untapped power of vector embeddings
frankvandijk
2
1.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
YesSQL, Process and Tooling at Scale
rocio
174
15k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
210
Transcript
Unit Testing React Day 2022
Ego Slide Luca Del Puppo (aka Puppo) Full-Stack Developer at
Flowing a Claranet Italian Company @puppo92 https://www.linkedin.com/in/lucadelpuppo/
[email protected]
The Test Pyramid
Jest vs React Testing Library (RTL)
Sporchiamoci le mani Example https://puppo.github.io/reactday-2022-workshop-testing/ Code https://github.com/Puppo/reactday-2022-workshop-testing
React Testing Library Selectors
Single Element Type of Query 0 Matches 1 Match >1
Matches Retry (Async/Await) getBy... Throw error Return element Throw error No queryBy... Return null Return element Throw error No findBy... Throw error Return element Throw error Yes
Multiple Elements Type of Query 0 Matches 1 Match >1
Matches Retry (Async/Await) getAllBy... Throw error Return array Return array No queryAllBy... Return [] Return array Return array No findAllBy... Throw error Return array Return array Yes
Query types - Queries Accessible to Everyone - getByRole -
getByLabelText - getByPlaceholderText - getByText - getByDisplayValue - Semantic Queries - getByAltText (img, area, input) - getByTitle - Test IDs - getByTestId
Thanks!
Give me your feedback
Milano Frontend - 25 Ottobre 2022 Registrazione https://tinyurl.com/zawyva9z
NgRome - 02 Ottobre 2022 Sito https://t.co/7Z4wXMapva Coupon (-15%) LucaCarbonara22