Closed broccolinisoup closed 1 year ago
Latest commit: 28989810d72a5f751a2f7b1bdc170cce69c2d9b4
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
Snapshots are failing and when I tried to update the snapshots on my local I receive below errors. Anyone has any idea?
@joshblack I have seen your recent commits for tests. Is this something you can help me with? Thank you ππΌ
`yarn run v1.22.19 $ jest -u FAIL tests/tree-shaking.test.js β Console
console.warn
'<local_path>/octicons/lib/octicons_react' is imported by virtual:__entrypoint__, but could not be resolved β treating it as an external dependency
at Object.defaultOnWarn [as onwarn] (node_modules/rollup/dist/shared/rollup.js:558:42)
at ModuleLoader.handleResolveId (node_modules/rollup/dist/shared/rollup.js:22490:26)
at node_modules/rollup/dist/shared/rollup.js:22451:26
β tree shaking
'<local_path>/octicons/lib/octicons_react' is imported by virtual:__entrypoint__, but could not be resolved β treating it as an external dependency
21 | onwarn: ({code, message}) => {
22 | if (code !== 'EMPTY_BUNDLE') {
> 23 | throw new Error(message)
| ^
24 | }
25 | }
26 | })
at onwarn (__tests__/tree-shaking.test.js:23:15)
at Object.onwarn (node_modules/rollup/dist/shared/rollup.js:23270:13)
at ModuleLoader.handleResolveId (node_modules/rollup/dist/shared/rollup.js:22490:26)
at node_modules/rollup/dist/shared/rollup.js:22451:26
βΊ 1 snapshot updated. FAIL src/tests/octicon.js β Test suite failed to run
Cannot find module './__generated__/icons' from 'src/index.js'
Require stack:
src/index.js
src/__tests__/octicon.js
10 | }
11 |
> 12 | export * from './__generated__/icons'
| ^
13 |
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:487:11)
at Object.<anonymous> (src/index.js:12:1)
at Object.<anonymous> (src/__tests__/octicon.js:4:1)
FAIL tests/public-api.test.js β Test suite failed to run
Cannot find module '../' from '__tests__/public-api.test.js'
> 1 | import * as Octicons from '../'
| ^
2 |
3 | describe('@primer/octicons-react', () => {
4 | it('should not update exports without a semver change', () => {
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:487:11)
at Object.<anonymous> (__tests__/public-api.test.js:1:1)
Snapshot Summary βΊ 1 snapshot updated from 1 test suite.
Test Suites: 3 failed, 3 total Tests: 1 failed, 1 passed, 2 total Snapshots: 1 updated, 1 total Time: 1.56 s Ran all test suites.`
@joshblack Also, do you have any recommendation on how to fix the failing snapshots here? I mentioned the issue above.
@broccolinisoup definitely! I think you can do:
# From the top-level
yarn
yarn build
cd lib/octicons_react
yarn
yarn jest -u
To update the snapshots. Sorry I missed this earlier!
@broccolinisoup definitely! I think you can do:
# From the top-level yarn yarn build cd lib/octicons_react yarn yarn jest -u
To update the snapshots. Sorry I missed this earlier!
I tried this yesterday but doesn't work π’ Same above issues. Tests are failing on the main as well due to the same "cannot find module" issues. At least on my local. I'll look into it more today and see what is going on.
@broccolinisoup definitely! I think you can do:
# From the top-level yarn yarn build cd lib/octicons_react yarn yarn jest -u
To update the snapshots. Sorry I missed this earlier!
I tried this yesterday but doesn't work π’ Same above issues. Tests are failing on the main as well due to the same "cannot find module" issues. At least on my local. I'll look into it more today and see what is going on.
All good now, sorry for the confusion π Building the octicon_react solved the unknown path issues , thank you!
ππΌ @joshblack!
Thank you so much for your review! The intent of this PR was for making sure the SVG items that have aria-hidden= true
, don't receive any focus by some assistive technology (here is Ericβs feedback about it) and because aria-hidden
was dependent on aria-label
, this is why I made the focusable
attribute dependant to aria-label
as well. Having said that, my solution was not inclusive enough I think in a way that I was solving the half of the problem, which is making sure SVG items donβt get focus when they have aria-hidden=true
, however, the solution doesnβt help if an SVG item needs to be focused. I know it is kind of out of the βscopeβ of the case I am working on but while I am already here why not implementing that as well! And your comments make so much sense! I have implemented it and pushed my commit. Please let me know if there is anything I am missing. I appreciate your review so much ππΌ
Looks great @broccolinisoup! Thanks so much for taking this on π
Looks great @broccolinisoup! Thanks so much for taking this on π
Thanks for your review @joshblack!
Seeking a review from @primer/octicons-reviewers π ππΌ
ππΌ This PR adds a new prop
focusable
to theIcon
React component. It is a feedback came from the accessibility review. Please see the commentAdd focusable="false" to SVG icons
hereI don't have much knowledge around svg icons so please let me know if this is a good way of doing it or any other feedback, I would appreciate ππΌ