Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass onUploadProgress function through to the axios request #6007

Merged

Conversation

moekify
Copy link
Contributor

@moekify moekify commented Jun 2, 2021

The AxiosRequest config allows for an onUploadProgress function to be passed in. This is useful, if we want to give users some kind of feedback about the progress of a potential file transfer. Currently, the sdk is only supporting this via direct access to the transport method, hence we are adding this extra param there.

I actually looked into writing a test for this in the existing framework. However, from what I understood this is all running in a node environment. As progress events are something that only happens in a browser context, I didn't know of a good way of asserting the function assignment happens as expected.

If someone sees a possibility, I'd be happy to pair up on it or get pointed in the right direction of how to achieve a test for this!

The AxiosRequest config allows for an onUploadProgress function to be passed in. This is useful, if we want to
give users some kind of feedback about the progress of a potential file transfer. Currently, the sdk is only supporting
this via direct access to the transport method.
@rijkvanzanten
Copy link
Member

I actually looked into writing a test for this in the existing framework. However, from what I understood this is all running in a node environment. As progress events are something that only happens in a browser context, I didn't know of a good way of asserting the function assignment happens as expected.

I don't think we can write a test for this without setting up a full headless browser testing environment as well 🤔

@rijkvanzanten rijkvanzanten merged commit 09a9f56 into directus:main Jun 3, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants