menu
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
# Svelte Help
view-forward
# TestCafe Help
view-forward
# Vue Help
view-forward
Team
Posts
Members
Info

Ant Design message is not cleared between tests?

Can someone help me to understand how this happens? Here I've a small component that uses Ant design message.success (https://ant.design/components/message/). I copied the same test twice. The first one passes, but second one fails because it finds more than 1 success message. …

thumbsup
0
message-simple
0

container.update() is not a function

This is the first time I've dealt with act() and I'm trying to act a mockRequest and then update the container and match a snapshot. Is this not possible with Testing Library? await act(async () => { 25 | mockRequest.catch(() => { }).then(() => { …

thumbsup
0
message-simple
2

Assert hidden content after button click

Hello everyone, I just joined the community and I do have a question, let me know if it is not the right place to post it: I've been trying to test a accordion, where the content of a div is hidden when a button is clicked and when I try to assert if the div content is hidden it…

thumbsup
0
message-simple
9

TypeError: Cannot read property 'then' of undefined

I am new in React testing. I am new in React testing. I am using React hooks. I fetched data from the database and pass the props to another component. My app works fine as expected. when I am testing my app and try to render the whole component it gives me test failed. It's…

thumbsup
0
message-simple
2

getting TypeError: MutationObserver is not a constructor on async tests

Starting a new feature (this time with tests) in an existing, rather big app. The component I am testing has Formik, and not much else. testing works until I introduce async. …

thumbsup
0
message-simple
3

How does one test redirection from one page to another

Inside of the login page, I have a form which triggers an redux action on a button click. Inside of that action creator, we have an async operation, which calls the api and triggers another action with the response. The problem is that even though the login works, I can't figure…

thumbsup
0
message-simple
4

Testing a carousel click drag feature ?

I am trying to test when you click drag then release a click, on a carousel. It should show a new element. The test fails because i am using e.target.offsetLeft in my mouseDown function which returns 0 ? How do i test this ? …

thumbsup
1
message-simple
3

Out of Memory error when doing expect(getByTestId()).not.toBeInTheDocument()

Get this error when trying to test if something is not in the document as in the Post title. But the check to see if the element is in the document passes. Seems like to test if it's not in the document, it tries to go all the way down to the deepest node and that might be…

thumbsup
1
message-simple
2

Best way to test clicking sidebar link renders a page?

I was wondering what the best way is to test that clicking on a sidebar link renders the correct page. FYI I am using React Router. This has been shown in many examples before but in those examples all the code is inside the App.tsx component, whereas I have my components split…

thumbsup
0
message-simple
10

Any great examples of unit- and integration-tests in some real applications?

Hi everyone, I have used the following test examples: • https://github.com/kentcdodds/react-testing-library-course/tree/master/src/tests …

thumbsup
1
message-simple
2