mantine-datatable icon indicating copy to clipboard operation
mantine-datatable copied to clipboard

Datatable broken under vitest / react-testing-library tests

Open Aram1d opened this issue 6 months ago • 3 comments

Describe the bug

  1. We built components with mantine-datatable and they work perfectly in our react app.
  2. We started to write tests using vitest / RTL / jsDom
  3. Tests for a given table do not work. Even when records prop is correctly populated, the noRecords message remains, and rows appears unpopulated.

To Reproduce Steps to reproduce the behavior:

very small repo with one table and one test to reproduce the issue: repo

Expected behavior I would expect to be able to get the rows with their data on my RTL tests so I can make assertions

Screenshots

The real table in the repo I linked: image

What's rendered on my RTL tests: image

Note the empty <tr> tags.

Desktop (please complete the following information):

  • OS: Kubuntu 24.04 LTS x86_64 with 6.8.0-39-generic kernel
  • Browser none (tests runs on node.js, v20.15.1)
  • Version 7.11.3

Additional context Add any other context about the problem here.

Aram1d avatar Aug 01 '24 10:08 Aram1d