alanvardy / tod

An unofficial Todoist command line client written in Rust
MIT License
104 stars 9 forks source link

Implement custom sorting #804

Open stacksjb opened 5 months ago

stacksjb commented 5 months ago

See https://github.com/alanvardy/tod/issues/793

Implement sorting based on appropriate predefined parameters and methods:

due datetime due date (allow custom due time) priority labels project alphabetical no sort (custom Todoist sort - default)

Allow layering of methods, such as priority then datetime

stacksjb commented 5 months ago

@alanvardy is there a way to stage test data (tasks) into tod for unit tests?

i.e. I'd like to load in 8 tasks with varying priorities, orders, and due dates (probably calculated as offset from date test is run) and then check they are sorted correctly for varying sort tests.

I get basic 'assert equals' unit tests but not sure about the test data part.

alanvardy commented 5 months ago

yes! Take a look at test::fixtures, and where I use it in the test suite, i.e. here

This should hopefully reduce the number of lines you need to write to create a task in test. Add another fixture or two as well if you find that you are repeatedly creating similar things.