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

Test for #9655 #9659

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft

Test for #9655 #9659

wants to merge 24 commits into from

Conversation

Dreamsorcerer
Copy link
Contributor

@Dreamsorcerer Dreamsorcerer commented Feb 11, 2024

@Dreamsorcerer
Copy link
Contributor Author

Well, this looks roughly like what I'd expect for a test to reproduce the issue, but I can't even figure out how to stop it showing no_results in the list view...

@fzaninotto
Copy link
Member

If you're not able to build a unit test demonstrating your problem, perhaps you could fork the simple example codesandbox and tweak it until it show the problem? Or does it only show in unit tests?

@Dreamsorcerer
Copy link
Contributor Author

Or does it only show in unit tests?

Yes, I mentioned it's only causing a test failure. It seems the dialog doesn't get closed in jest-dom, whereas it does get closed in Firefox when using it as a normal user.

@fzaninotto
Copy link
Member

In that case, we'll wait until you can provide a unit test that fails because of the issue you mentioned.

@Dreamsorcerer
Copy link
Contributor Author

Any tips on how to make it display some results? I'm copying from other, similar tests in this project, so can't see why it's not working here if it's working in those other tests..

@slax57
Copy link
Contributor

slax57 commented Feb 15, 2024

Any tips on how to make it display some results? I'm copying from other, similar tests in this project, so can't see why it's not working here if it's working in those other tests..

Tests results are visible in the logs:
https://github.com/marmelab/react-admin/actions/runs/7863886168/job/21455003047?pr=9659#step:5:3073

If you cloned the project locally and already ran make install successfully, you should be able to run the tests and iterate on it by running make test-unit-watch.

@Dreamsorcerer
Copy link
Contributor Author

Any tips on how to make it display some results? I'm copying from other, similar tests in this project, so can't see why it's not working here if it's working in those other tests..

Tests results are visible in the logs: https://github.com/marmelab/react-admin/actions/runs/7863886168/job/21455003047?pr=9659#step:5:3073

Sorry, I don't think I was clear. I meant, if you look at the test output it renders ra.navigation.no_results. I don't understand why the list view has no results when I've added a dataProvider with getOne, getList and getMany. It looks similar to the other tests in this project...

@slax57
Copy link
Contributor

slax57 commented Feb 16, 2024

Thanks for the additional explanations.

I believe the list is empty because you are providing a ListContextProvider with no data. If you expect the list to call getList, you should use the useListController via either List or ListBase.

@fzaninotto
Copy link
Member

May I suggest you test your changes locally before pushing them? We get notified of each of your tries.

@Dreamsorcerer
Copy link
Contributor Author

I wasn't able to run the tests locally using the instructions. Currently, the record data seems to be failing to update from the bulk update button entirely. Not sure why this isn't working...

@fzaninotto fzaninotto closed this May 3, 2024
@fzaninotto fzaninotto reopened this May 3, 2024
@fzaninotto
Copy link
Member

Sorry, I closed this PR by mistake.

I have created a test for the BulkUpdateButton in #9826, and it seems to work fine. Unless you can tweak this test to make it fail, we'll consider that the problem is on your side.

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

Successfully merging this pull request may close these issues.

None yet

3 participants