Add BankAccountForm component tests - #122
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Tanvee Joshi <tanvee.joshi@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Adds a new Cypress component test file
src/components/BankAccountForm.cy.tsxcovering theBankAccountFormcomponent, following the pattern used insrc/components/SignInForm.cy.tsx(cy.mountwithMemoryRouter, callbacks stubbed viacy.stub()).The suite has 7 tests covering:
bankNamevalidation errors (min 5 chars, required).routingNumbervalidation errors (length 9, required).accountNumbervalidation errors (min 9, max 12, required).createBankAccountis called with the expected payload on submit.onboarding=trueprevents navigation away from the form after submit.All 7 tests pass locally with
yarn cypress:run:component --spec src/components/BankAccountForm.cy.tsx.Notes
validateOnMountisfalse), soisValidstarts astrueand the submit button is enabled on the very first render. The test focuses+blurs each empty field to trigger validation and confirm the button becomes disabled when required fields are empty. This preserves the spirit of the assertion (submit must be disabled when fields are invalid) without modifying the production component.[data-test=bankaccount-*-input]selectors on the MUITextFieldwrapper; clear/blur operations use.find("input")to drill into the underlying native input, mirroring the existing E2E pattern incypress/tests/ui/bankaccounts.spec.ts.Review & Testing Checklist for Human
yarn cypress:run:component --spec src/components/BankAccountForm.cy.tsxlocally and confirm all 7 tests pass.disabled) is acceptable, or request thatvalidateOnMount={true}be added toBankAccountForm.tsxinstead so the assertion can be made on mount with no interaction.calledWithpayload shape in Test 6 matches what downstream code expects fromcreateBankAccount.Link to Devin session: https://app.devin.ai/sessions/a26eddde9d9e4d04bee56dc75c8809f5
Requested by: @tanveejoshi-dev
Devin Review