-
-
Notifications
You must be signed in to change notification settings - Fork 351
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
[bugfix] fix unordered favorites #1245
[bugfix] fix unordered favorites #1245
Conversation
55357b8
to
3c67506
Compare
3c67506
to
a202bd4
Compare
I'm still unsure whether to provide a test. What exactly would you like to be seen tested in this case? |
Will respond to this later today, I've got some ideas :) |
@tsmethurst Sure, let me know - happy to implement and improve testing! :) |
So I think a good way of more or less end-to-end testing this would be to just put some faves in the db, then retrieve them via the handler (so, a test in here somewhere: https://github.com/superseriousbusiness/gotosocial/tree/main/internal/api/client/favourites), and check that they're ordered correctly, and that the link headers are what we would expect. You can look around in some of the other api packages for some inspiration on testing, since we do something similar in a lot of places :) What do you think? |
a202bd4
to
0e76843
Compare
0e76843
to
5222bfc
Compare
@tsmethurst I added a test, I hope this is what you expect. I added some test data, as you suggested, fetching the favorites of |
Great stuff, thank you! Can you add the license text header to the new files (just copy and paste from another .go file)? Then this is ready to be merged imo 👍 |
✅ Done! |
Thanks! |
Description
This pull request fixes the ordering of favorites list.
closes #1151 (improves solution of #1236)
Checklist
Please put an x inside each checkbox to indicate that you've read and followed it:
[ ]
->[x]
If this is a documentation change, only the first checkbox must be filled (you can delete the others if you want).
go fmt ./...
andgolangci-lint run
.