[openstreetmap/openstreetmap-website] Don't assume order when testing links to changeset elements (PR #4571)

Andy Allan notifications at github.com
Wed Mar 13 16:20:28 UTC 2024


> But actually they are not sorted, so sometimes the order may be different.

Good catch.

Would it be a better idea for us to sort the elements instead? I've had a brief look at the website, and it would seam reasonable to sort the elements by id and version. That way the order is stable, and also might be helpful for mappers too (e.g I think if I saw nodes 1, 2, 5, ..., 20 on the first page, I'd be surprised to find node 4 mentioned on page 7).

I also think the test could be improved. At the moment the test creates 21 items for each type of element, and then checks that the first 20 are visible. But it doesn't check that the 21st item is *not* visible, and it doesn't check that there are page links to view the next page. I can see what you are doing with the changes that you propose, but I think that leads to a very complex test, in order to handle a situation (lack of sort order) that I don't think is intentional.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4571#issuecomment-1994856482
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4571/c1994856482 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240313/671207c9/attachment.htm>


More information about the rails-dev mailing list