How do it test an initial disabled submit button thanks to "invalid "? #3833
Unanswered
theolavaux
asked this question in
Q&A
Replies: 1 comment
-
|
Sorry I missed this. This could be due to the validation being async. So you could try doing |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'd like to test that my form cannot be submitted on page load when the user has not filled my form yet, following this pattern:
https://vee-validate.logaretm.com/v3/advanced/testing.html#testing-validationobserver-debounced-state
This is the test I wrote for it
Note:
toBeDisabledcomes from@testing-library/jest-dom, source hereHowever this doesn't seem to work as expected
FAIL test/integration/components/ui/RegistrationForm.test.ts (5.069 s) Registration form ✕ should activate/deactivate the form confirmation button when the form is valid/invalid (281 ms) ● Registration form › should activate/deactivate the form confirmation button when the form is valid/invalid expect(element).toBeDisabled() Received element is not disabled: <button type="submit" /> 76 | }); 77 | > 78 | expect(confirmationButton).toBeDisabled(); | ^ 79 | at Object.<anonymous> (test/integration/components/ui/RegistrationForm.test.ts:78:32)My template looks like
Generated DOM from
render, missing thedisabledattributeBeta Was this translation helpful? Give feedback.
All reactions