Skip to content
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

fix missing aria-label #2190

Merged
merged 1 commit into from Jun 16, 2023
Merged

fix missing aria-label #2190

merged 1 commit into from Jun 16, 2023

Conversation

jshawl
Copy link
Member

@jshawl jshawl commented Jun 15, 2023

Description

This PR is a follow up to #2169 (29a18ec) that introduced an issue related to the correct content not being available.

Why are we making these changes? Include references to any related Jira tasks or GitHub Issues

If some content is available, but not the correct content, the aria-label goes missing because labelText is undefined.

Additionally, the tests in style.js were silently passing because done was not passed to it() and the test reported a success before the button rendered.

Reproduction Steps

Visit https://developer.paypal.com/demo/checkout/#/pattern/server and update the sdk script url to include a locale that does not have corresponding content:

<script src="https://www.paypal.com/sdk/js?client-id=test&currency=USD&locale=en_GB"></script>

Then, add a style property with a label property:

paypal.Buttons({
  style: {
    label: 'pay'           
  },
  createOrder: ...

Observe that there is no aria-label on the .paypal-button element

Screenshots

Screen Shot 2023-06-15 at 15 08 27

❤️ Thank you!

This PR is a follow up to paypal#2169 (29a18ec) that introduced
an issue related to the correct content not being available.
@jshawl jshawl marked this pull request as ready for review June 15, 2023 20:17
@jshawl jshawl requested a review from a team as a code owner June 15, 2023 20:17
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.10 ⚠️

Comparison is base (29a18ec) 51.58% compared to head (5b09b3a) 51.48%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2190      +/-   ##
==========================================
- Coverage   51.58%   51.48%   -0.10%     
==========================================
  Files         101      104       +3     
  Lines        1983     2014      +31     
  Branches      582      586       +4     
==========================================
+ Hits         1023     1037      +14     
- Misses        862      878      +16     
- Partials       98       99       +1     
Flag Coverage Δ
jest 31.95% <100.00%> (+0.14%) ⬆️
karma 50.21% <0.00%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/funding/paypal/config.jsx 83.33% <100.00%> (+25.00%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@jshawl jshawl merged commit de70f4d into paypal:main Jun 16, 2023
2 of 3 checks passed
@jshawl jshawl deleted the fix/missing-aria-label branch June 16, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants