You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Had a hell of a time trying to figure this one out. Thought I would share the solution I found here to help anyone else trying to set up automated Jest tests with ReactChessboard.
Solution for writing automated tests with Jest
npx create-react-app react-chessboard-jest-testing, cd react-chessboard-jest-testing
npm i react-chessboard
npm i --save-dev react-dnd-test-utils react-dnd-test-backend
Using querySelector is not necessarily a best practice. By adding aria roles and labels, those calls could be replaced with the more standard testing-library queries.
I'm by no means an expert on accessibility. I went to both chess.com and lichess.org to see how they approach this, and it seems that they don't yet have any support for screen readers. Would be nice to get input from someone more knowledgeable about accessibility before making these changes and to think more broadly about the experience for visually impaired players.
The text was updated successfully, but these errors were encountered:
This is incredible, I've only had a brief read through as I'm very busy lately but when I get time I will try to turn this into some documentation that everyone can reference if they need to test, and I'll try to have a think about how testing could be improved/made easier as you suggested
Hello, I am Rahul a blind person. I am regular screen reader user. As mentioned here I also notice that the library does not work well with the screen readers. . This can have huge impact. any website wich uses this library, will be completely in accessible for blind people like me. If allowed ,I would like to work and help in fixing this.
Had a hell of a time trying to figure this one out. Thought I would share the solution I found here to help anyone else trying to set up automated Jest tests with ReactChessboard.
Solution for writing automated tests with Jest
npx create-react-app react-chessboard-jest-testing
,cd react-chessboard-jest-testing
npm i react-chessboard
npm i --save-dev react-dnd-test-utils react-dnd-test-backend
Getting Jest to play nicely with ESM modules
Writing the test
Tested on:
npm list
:├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]
Brainstorming possible improvements
Using querySelector is not necessarily a best practice. By adding aria roles and labels, those calls could be replaced with the more standard testing-library queries.
I'm by no means an expert on accessibility. I went to both chess.com and lichess.org to see how they approach this, and it seems that they don't yet have any support for screen readers. Would be nice to get input from someone more knowledgeable about accessibility before making these changes and to think more broadly about the experience for visually impaired players.
The text was updated successfully, but these errors were encountered: