- Issue created by @fjgarlin
When working on regenerating the fixture, a few things came out, that make it difficult to do this regeneration (which might be needed every now and then).
For example:
- It doesn’t make sense to check whether we have 4564 results or 1897 results. We just want results, so we can change things for regex checks instead.
- When checking list of returned modules, the lists should be small rather than having 8-10 modules, as results can change.
- One of the tests checks for the newest modules… this will always change on regeneration.
A few things were made in the parent issue, however I think that we should really simplify some of the tests in ProjectBrowserUiTestJsonApi.php
.
More examples:
- Why testing sorting if we've already tested PB sorting somewhere else. This could be a kernel or unit test for the endpoint, but not a functional one.
- Similar things with filtering, paginating, etc.
See the parent issue and all the commits needed to get the tests right. The regeneration of the script took a minor part of the issue, and that was supposed to be the issue itself.
Simplify or move tests against the jsonapi endpoint to be unit or kernel tests. The fixture regeneration script gets the real data, the middleware makes it so we don't query d.o every time, but the tests should just be checking whether the json data is the expected or not, rather than doing complex UI assumptions.
Active
2.0
Code