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

Add tests for clicks #5

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Add tests for clicks #5

wants to merge 6 commits into from

Conversation

Pokesi
Copy link
Contributor

@Pokesi Pokesi commented Jan 29, 2023

Add tests for interactive components using the react testing library

@Pokesi
Copy link
Contributor Author

Pokesi commented Jan 29, 2023

why cant i just use container methods 😭

src/App.tsx Outdated Show resolved Hide resolved
@@ -18,6 +18,7 @@ function ConeOrCube(props: { piece: cubeOrCone }): JSX.Element {
return (
<div
className="coneOrCube"
role="none"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't none the default role for a <div>?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ESLint complained about it - but maybe i had something there before

Copy link
Contributor Author

@Pokesi Pokesi Jan 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tests dont passif the role isnt defined as none

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we shouldn't be setting the ARIA role to none anyway. It sounds like your tests are abusing the ARIA role to select this element. Maybe find a different selector? You have a class name on this after all...

src/App.tsx Outdated Show resolved Hide resolved
Copy link
Member

@auscompgeek auscompgeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, what is this tests.txt?

@@ -18,6 +18,7 @@ function ConeOrCube(props: { piece: cubeOrCone }): JSX.Element {
return (
<div
className="coneOrCube"
role="none"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we shouldn't be setting the ARIA role to none anyway. It sounds like your tests are abusing the ARIA role to select this element. Maybe find a different selector? You have a class name on this after all...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants