Open stacksjb opened 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.
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.
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