menu

Testing Library

Simple and complete DOM testing utilities that encourage good testing practices.

Channels
Chat
view-forward
# All channels
view-forward
# General
view-forward
# General Help
view-forward
# Angular Help
view-forward
# Cypress Help
view-forward
# DOM Help
view-forward
# React Help
view-forward
# TestCafe Help
view-forward
# Vue Help
view-forward
Team
Posts
Members
Info

fireEvent.click on functional components

Hi , Can anyone please help me with the below: Code I am testing: …

thumbsup
0
message-simple
4

Using await wait properly

Is this correct syntax? Because I get the same results whether I use .not.toBeVisible()

thumbsup
0
message-simple
0

Testing form errors

For example So I would like to assert the first field does not have an error and the second and third fields does have an error. It can be done using within utility, but this requires knowledge of the DOM structure. Since each "field" is actually rendered using an external…

thumbsup
0
message-simple
17

Testing tables

Hi All I'm trying to assert how many rows are in a table It should be simple enough but I can't find a way to to queryXXX('tr') or equivalent …

thumbsup
0
message-simple
6

How to mock setState?

my event handler change state by using setState I need to mock how can I do that?

thumbsup
0
message-simple
2

Using Mirage with Testing Library to mock the network

Hey Testing Library community! I've been using TL more and more recently and really love it. I've worked a lot with Ember's testing in the past and philosophically, TL is very aligned with that. The goal is to always keep tests written at one level of abstraction, and the…

thumbsup
3
message-simple
1

Looking for thoughts on testing table structure

Our app is largely built around tables and their structure. Users need to be able to look at row & column labels and decide where to enter specific data points. Thus far we've largely made our assertions on the fact that data shows up in the table at all. Lately, however, it has…

thumbsup
0
message-simple
14

React: Test select options list (ie, test ordering)

What are patterns that are available in react-testing-library to test the options list of a select element itself? When I search for solutions, I often see people running into (solvable) challenges with interacting with a select element. However, there is very little about…

thumbsup
0
message-simple
1

Test the width of an element

How can i test the width of a the button when the button is clicked, or the isLoading property is true? In jest is something like expect(loginButton.prop('width')).toBe('80%');

thumbsup
0
message-simple
1