mantine-datatable
mantine-datatable copied to clipboard
Datatable broken under vitest / react-testing-library tests
Describe the bug
- We built components with mantine-datatable and they work perfectly in our react app.
- We started to write tests using vitest / RTL / jsDom
- Tests for a given table do not work. Even when
records
prop is correctly populated, thenoRecords
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:
What's rendered on my RTL tests:
Note the empty <tr>
tags.
Desktop (please complete the following information):
- OS:
Kubuntu 24.04 LTS x86_64
with6.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.