Back to Browse

React JS Testing Lists (TDD) | React Testing Library

3.9K views
Jan 31, 2021
16:54

In this video I show you how to test lists in React.js! We'll take a test driven development (TDD) approach to first focus on writing the tests, then the implementation. I also cover strategies to write the code for accessibility as well as various techniques to make it all better! 00:00 - Intro 00:16 - Overview of files and code 00:45 - Testing for empty states 02:00 - Implementing empty state 03:01 - Testing for rendering items 04:59 - Testing for list order 06:03 - Querying by ARIA roles 08:04 - Asserting list lengths 08:39 - Asserting list order 09:35 - Implement list functionality 10:18 - Implementing sorting 11:47 - Utilizing snapshots 12:45 - Providing roles manually 13:45 - Using data-testid instead 14:53 - Some callouts 16:29 - Conclusion

Download

1 formats

Video Formats

360pmp427.8 MB

Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.

React JS Testing Lists (TDD) | React Testing Library | NatokHD