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

Implement tests for CreateOrJoinNH component #18

Open
2 tasks
pospi opened this issue Sep 6, 2023 · 3 comments
Open
2 tasks

Implement tests for CreateOrJoinNH component #18

pospi opened this issue Sep 6, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@pospi
Copy link
Collaborator

pospi commented Sep 6, 2023

Following on from #12.

This will require working through use of @storybook/test-runner and @storybook/testing-library utility functions: https://storybook.js.org/blog/interaction-testing-with-storybook/

  • Assert that it dispatches a create-nh event when the appropriate button is clicked
  • Assert that it dispatches a join-nh event when the appropriate button is clicked and sends the CA pubKey in the expected event payload format
@pospi pospi added the enhancement New feature or request label Sep 6, 2023
@pospi pospi added this to NH alpha 2 Sep 6, 2023
@pospi
Copy link
Collaborator Author

pospi commented Sep 11, 2023

@weswalla I went ahead and started implementing this in #17 as well- I figure the two should be in the same PR.

Selection and interaction handling seems to be working, but there is some issue with the Jest mocks and event listeners which is preventing the assertions from working as expected. There may also be a bug with the create-nh event since it's currently not set to bubbling or composed, but you know better than me whether that is intentional.

Would you mind taking over? I think it's close. FYI I added some links to the various testing libraries' documentation in the developer docs since they aren't very well organised.

@weswalla
Copy link

@pospi I'm looking into this now

@pospi
Copy link
Collaborator Author

pospi commented Sep 21, 2023

☹️ storybookjs/test-runner#336

@pospi pospi moved this to 🏗 In progress in NH alpha 2 Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: 🏗 In progress
Development

No branches or pull requests

2 participants