-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
test: expand test coverage around forms #4365
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for that js/no-js refactoring 🙌🏼
Shouldn't the tests related to #4342 fail?
@machour the new tests do fail with JavaScript enabled, but they are annotated with So when we fix the behavior, we'll need to remove those annotations as well, otherwise the tests will start failing because they are passing 😆 |
I'm thinking it might be good to merge this PR independently of the actual fixes, since it expands coverage generally and gives us a little more flexibility in how/when we fix ... e.g. file handling fix could be separate from submitter fixes, and I have two proposals on how to fix the latter (implement the spec vs. do some temporary form DOM shenanigans) |
@jenseng agreed. I'll get eyes on this soon! |
8bd158f
to
ec8ce3d
Compare
thank you @jenseng! 🙌 didn't realize these we were only running these with js enabled 😱 edit: looks like something went awry on |
In light of this imminent fix I'll rebase and amend the tests, as this is one instance where |
* Rework all form tests to run both with and without JavaScript. This way we can better detect/prevent regressions or inconsistencies between how <form> and <Form> work. * Dedup and expand form method tests to ensure we cover all supported Form methods and submitter formMethods * Expand coverage around form serialization (tree order, image submit buttons, files in URL-encoded payloads) * Conditionally mark tests as failing (via test.fail): * Non-get/post <Form> methods with JavaScript disabled (remix-run#4420) * Form serialization problems with JavaScript enabled (remix-run#4342)
0c10a0d
to
718cef5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great @jenseng - thank you!
@jenseng Have you already started working on fixes to these issues or should we prepare for that internally? I'd like to prioritize these bugs for the next release if possible. |
@chaance I've got fixes/PRs basically ready, was just holding off till this gets merged... IMO the url-encoded-files fix should probably be a separate PR from the submitter fixes, and I have two proposals/approaches for the latter |
@jenseng Would you mind tagging me on those as well? We'll want the same changes in |
* Rework all form tests to run both with and without JavaScript. This way we can better detect/prevent regressions or inconsistencies between how <form> and <Form> work. * Dedupe and expand form method tests to ensure we cover all supported Form methods and submitter formMethods * Expand coverage around form serialization (tree order, image submit buttons, files in URL-encoded payloads) * Conditionally mark tests as failing (via test.fail): * Non-get/post <Form> methods with JavaScript disabled (#4420) * Form serialization problems with JavaScript enabled (#4342)
Expand test coverage around forms:
<form>
and<Form>
work.method
s and submitterformMethod
stest.fail
):<Form>
methods with JavaScript disabled (Deprecate non-GET/POST <Form> methods? Or polyfill when scripts are missing/pending/disabled? #4420)References: #4342