modus-web-components icon indicating copy to clipboard operation
modus-web-components copied to clipboard

Switch: Completely remove `aria-checked` from switch, set `id` on `input` to be the same as `label`, replace brittle unit test with more precise e2e test

Open austinoneil opened this issue 1 year ago • 3 comments

Description

Completely remove aria-checked from switch, set id on input to be the same as label, replace brittle unit test with more precise e2e test

References https://github.com/trimble-oss/modus-web-components/pull/2450

Type of change

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [ ] Documentation update

How Has This Been Tested?

https://deploy-preview-2455--moduswebcomponents.netlify.app/?path=/story/user-inputs-switch--medium

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules
  • [x] I have checked my code and corrected any misspellings

austinoneil avatar Apr 20 '24 20:04 austinoneil

Deploy Preview for moduswebcomponents ready!

Built without sensitive environment variables

Name Link
Latest commit 6cba23c5534a04baa2c123b3f9cef24ad82665ba
Latest deploy log https://app.netlify.com/sites/moduswebcomponents/deploys/6639788277ad130008565e88
Deploy Preview https://deploy-preview-2455--moduswebcomponents.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

Lighthouse
1 paths audited
Performance: 26 (no change from production)
Accessibility: 98 (no change from production)
Best Practices: 92 (no change from production)
SEO: 92 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Apr 20 '24 20:04 netlify[bot]

When the switch is checked the input should have the checked attribute This issue is also present in main. It is definitely strange, as the checked attribute is added to the input element. I think this should be filed as an issue.

I've fixed the other two issues.

austinoneil avatar Apr 27 '24 05:04 austinoneil

oh, found a bug. Clicking on the label should change the state like this: https://modus.trimble.com/components/web/switches/#overview

coliff avatar May 07 '24 06:05 coliff