Unit testing - list view

Hello All,

I have a list view element with select components in it.

How can I create unit test for such use case?

Thanks in advance for any tip.

Hi @heynoway Thanks for reaching out! At the moment, we don't have much support for testing. We're currently working on an integration with Cypress. This will provide a test mode with stable test-ids to make it possible to write end-to-end tests in Cypress (and other compatible web drivers).

In the meantime, we'd love to hear some feedback on the ways in which you'd like to use a testing feature. Are there any other tests you'd be interested in running? What did you want to test about the selects?

Hi @Tess,

I have a list view component that contains multiple dropdowns and a transformer that calculates multiple values based on those dropdown selections. I've created a test with the following steps:

  1. Mock a query to set the list and dropdown values.
  2. Calculate the transformer.
  3. Assert the results.

However, the test is quite unstable. It never works at the "Run test suite" level. I need to open the test and run it a few times to get the correct result. The worst part is that failed tests still show correct transformer values (even when failing for single-value asserts).

Thanks for reporting this! :disappointed: Sorry to hear! I've flagged this to our team internally.

The feature that you're referring to is in Maintenance mode, meaning that we’ll look to fix high-priority bugs that block critical functionality, but not add any new features to this version. Hopefully, we'll have an update on our new Cypress testing feature soon!