ui-monorepo
ui-monorepo copied to clipboard
Programmatic upload of files
Many files interactions require a first step of files being uploaded. While this flow is tested once in the files-management spec. All the subsequent tests (such as testing for the file deletion) should not use the UI to upload files.
I imagine this involves:
- create a new
fileUploadcommand - mimick (or better, export and re-use)
uploadFilesfrompackages/files-ui/src/Contexts/FilesContext.tsx - use this in place of the manual process
Removed myself from this after figuring out it'll be much bigger than expected (and it's not really a priority as of now). Unless we want to duplicate many things (we don't want!). We need to:
- get the private key from localStorage
decodedRefreshToken.enckey - extract the encrypting functions used in react context to make sure we can import them in the test
- use those functions to encrypt the files
- use FilesApiClient to upload them