Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run data grid tests outside of your library #936

Open
richardnabu opened this issue Apr 7, 2024 · 0 comments
Open

Unable to run data grid tests outside of your library #936

richardnabu opened this issue Apr 7, 2024 · 0 comments

Comments

@richardnabu
Copy link

richardnabu commented Apr 7, 2024

Hello, very interested in your library and would like to use it in a production scenario !
Unfortunately, I cannot for the life of me get your tests to work outside of your repo.

Looking through the issues, I see some others have had a similar problem.

To be clear, we'd be willing to pay to find a solution, and to help in documenting a working setup for everyone.
I've gone ahead an put together a minimal setup here

https://codesandbox.io/p/sandbox/glide-test-86v3hn

You can simply download, run "npm i" and then "npm run test" and it should show you the 3 tests.

I've put in a generic test and also one of your own tests, and used all the test-utils items from your repo in the tests. I also put a generic "Canvas" test to show that this is not an issue with rendering canvas elements when using jest / typescript.

As noted in the other issues, the problem is that the element is never rendered in the test. Exactly the same component renders correctly in a real browser, so there is clearly some kind of issue with the testing setup.

The repo above uses Create React App, but our production setup does not and we have the same behaviour. I also see that your repo uses vitest, and the above repo uses Jest... we would need a setup that works with Jest.

I can also confirm that

  • the wrapper is correctly rendered, I use the same wrapper as you do in your tests
  • the DataEditor has rows, columns and getCellContent - again I use the same mocks as you do in your tests, and I can confirm the same component rendered in the browser is not empty
  • the DataEditor clearly renders, as the "ref" property is correctly set up, although for example ref.current.getBounds() returns undefined

Please let me know if you'd be interested to work on this, or if you need any more information.

Many thanks in advance, and congratulations for a wonderful project !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant