I've created various tests for authorization (both end-to-end, as in lib, as in server), but creating tests for more complicated scenarios is quite bothersome. I think I need to create some helper functions that improve developer experience and help me speed up how fast I can create these scenarios.
Some scenarios that should be tested:
- A grants B some rights. B creates Invite that grants themself rights. A retracts B's rights. B uses earlier created Invite. Opening the Invite should result in an Unauthorized error.
- A grants B some rights to resource R through some parent P. P is removed. R should not be accessible.
Ideas on better test tools / helper functions
- Helper function that creates a Store + owner + guest + resource + parent.
- Helper function for creating an Invite.