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

Help with testing the display and compliance of the icon

I need to check whether the icon (svg) that I downloaded is displayed and whether it matches the one that I downloaded Thanks!

thumbsup
0
message-simple
1

How do you test error boundaries?

I have a jest test which checks whether an error is caught by an error boundary. My test runs to completion, passing all the expect()s, but jest still throws an error on the console. I can't work out whether the React component is not consuming the error. Maybe that's a React…

thumbsup
0
message-simple
1

Help with testing react-date-picker

I am really struggling to test a component having react-date-picker in it. I think the onChange event isn't triggered when fireEvent.Change is used to change the content of react date picker. Any help would much appreciated. Thanks.

thumbsup
0
message-simple
1

React-Redux Testing issue

I have a component that I am testing that is using redux, so I looked in RTL and saw the example with redux. I setup 3 tests. If I run this, the 1st and 2nd times are correct, however in the 3rd test which is the same as the 1st it fails and the value is $0. If I comment out the…

thumbsup
0
message-simple
3

Did getByText change recently?

I have some HTML that looks like this: And we are using a test that does: It used to work fine, but now it's telling me it can't find that phone number. If I switch to doing a RegExp it works, but I'm curious to see if I'm just doing something wrong.

thumbsup
0
message-simple
0

Simple setup not working

I haven't used React Testing Library in a few months and now I'm working in a component on an app created with Create React App. The component has a few simple tests, nothing too complicated, but I'm getting a syntax error (Unexpected Token) that points to this: The error is…

thumbsup
0
message-simple
1

How to test that a container component changes display when setState is called

I am trying to figure out the right way to test a container component. App is a component that uses the useState hook to keep track of whether it should be showing FirstComponent or SecondComponent. NavBar is a component that invokes the setShowComponent function when either of…

thumbsup
0
message-simple
3

Testing function under Droppable from react-beautiful-dnd

Guys I trying to test a component with a function inside a button under Droppable from react-beautiful-dnd, but the html is not rendering because it seems that testing library is not getting html from child component. I cannot test it directly because it is part of Droppable…

thumbsup
0
message-simple
0

Testing transiently accessible functionality

I'm looking for advice on how to test functionality that is only accessible during the lifetime of an asynchronous method. I have posted this question at StackOverflow, including a CodeSandbox reproduction of the problem I'm hitting but it hasn't attracted any answers. If anyone…

thumbsup
0
message-simple
0

Greetings

Do you have something experience with enzyme and more important with migration from enzyme to react-testing-library ? Could you share with me: Why he decided to switch from enzyme to react-testing-library ?

thumbsup
0
message-simple
5