Create stub React submission upload component flow#3964
Merged
Conversation
**Why**: These restrictions are useful for runtime components, but unnecessary overhead for written tests.
**Why**: While the API endpoints for submitting the document upload form values does not yet exist, it can be abstracted as a function which receives a payload object and returns a Promise resolving or rejecting by the result of an attempt to upload. This implements Suspense-based asynchronous component handling, and introduces an optional upload context used in tests to replace the submission handler with a mock value.
2c1c197 to
7b829f1
Compare
**Why**: So the React component renders in the page See: #3929 (comment)
Contributor
Author
|
In e370137, I sneak in a quick fix to an issue present in master, explained in #3929 (comment) . Not directly related to the changes here, but necessary to verify the behavior in the browser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relates to: LG-3023
Why: While the API endpoint for submitting the document upload form values does not yet exist, it can be abstracted as a function which receives a payload object and returns a Promise resolving or rejecting by the result of an attempt to upload.
This implements Suspense-based asynchronous component handling, and introduces an optional upload context used in tests to replace the submission handler with a mock value.
Screen recording:
Resources: