ui-monorepo icon indicating copy to clipboard operation
ui-monorepo copied to clipboard

Programmatic upload of files

Open Tbaut opened this issue 4 years ago • 1 comments

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 fileUpload command
  • mimick (or better, export and re-use) uploadFiles from packages/files-ui/src/Contexts/FilesContext.tsx
  • use this in place of the manual process

Tbaut avatar Jun 17 '21 10:06 Tbaut

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

Tbaut avatar Jun 21 '21 16:06 Tbaut