-
Notifications
You must be signed in to change notification settings - Fork 161
feat(bankTransfer): support new countries and new fields #3543
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
base: main
Are you sure you want to change the base?
Conversation
|
✅ Deploy Preview for adyen-web ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
size-limit report 📦
|
expect(await screen.findByText('Branch code')).toBeInTheDocument(); | ||
expect(await screen.findByText(mockResult.branchCode)).toBeInTheDocument(); |
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.
To test for accessibility better here we should find the value based on the label i.e
expect(screen.getByLabelText('Branch code').innerText).toBe(mockResult.branchCode)
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.
You mean to make sure it's a semantic label? I'm going to test, but I think is a limitation of testing-library
and it not considering that definition lists are labels
, but my memory could be wrong. Honestly just copy and pasted from the code above.
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.
Yeah, it's not a label so what we do for example in PayTo.test.ts:L303 is:
const mandateAmount = screen.getByText('Amount').nextSibling;
expect(mandateAmount).toHaveTextContent('Up to A$40.01 per transaction');
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.
I think this also might be related: testing-library/dom-testing-library#140
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.
Two options I would like to propose. So I see that indeed, the bank instructions table component does not tie the label to the fields. This is actually not great accessibility wise.
Could we take this opportunity to either
- Refactor the markup to use a grid with each label actually using a label element with an id to link it to its value. One drawback here is that we might break backwards compatibility with the styles perhaps we can keep the classnames and still do this
- Simply just use
aria-labeledby
andid
props with the current markup. Then we can use thegetByLabelText
tests
What do you think?
|
Summary
This adds support for new
bankTransfer
variants and also support for 2 new fieldsbankCode
andbranchCode
.Tested scenarios
Fixed issue: