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

Configure UI unit tests #167

Merged
merged 3 commits into from
Jul 13, 2024
Merged

Configure UI unit tests #167

merged 3 commits into from
Jul 13, 2024

Conversation

s2sa4v
Copy link
Collaborator

@s2sa4v s2sa4v commented Jul 11, 2024

Configures Jest test runner with testing-library/react.
Adds a simple test to assistand-builder to verify that everything is working and can be mocked.
Updates Readme file. Adds UI Setup instructions.

Closes #169

@s2sa4v s2sa4v force-pushed the stas/configure-ui-unit-tests branch from 7e5b29d to f7088e5 Compare July 12, 2024 01:03
@s2sa4v s2sa4v marked this pull request as ready for review July 12, 2024 01:08
Copy link
Collaborator

@krishokr krishokr left a comment

Choose a reason for hiding this comment

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

Awesome, thanks Stas! Were there any updates / modifications needed for server side components (we don't have many though right now if at all... been just trying to build first)? Or do you think it will just work as normal?

@s2sa4v
Copy link
Collaborator Author

s2sa4v commented Jul 12, 2024

Awesome, thanks Stas! Were there any updates / modifications needed for server side components (we don't have many though right now if at all... been just trying to build first)? Or do you think it will just work as normal?

Great question, Kris! I do not have any experience with testing server side components yet but I believe that if they are not async server components, we should be able to test them with this setup.
Async server components are recommended to be tested with e2e. I am not planning on configuring e2e tests right now, though. I think it's a bit early for e2e tests but we can talk about that.

@s2sa4v s2sa4v changed the title Stas/configure UI unit tests Configure UI unit tests Jul 12, 2024
@krishokr
Copy link
Collaborator

Awesome, thanks Stas! Were there any updates / modifications needed for server side components (we don't have many though right now if at all... been just trying to build first)? Or do you think it will just work as normal?

Great question, Kris! I do not have any experience with testing server side components yet but I believe that if they are not async server components, we should be able to test them with this setup. Async server components are recommended to be tested with e2e. I am not planning on configuring e2e tests right now, though. I think it's a bit early for e2e tests but we can talk about that.

Sounds good! That totally makes sense - yeah, definitely no async server components yet. I was having some trouble getting ReactQuery to play with SSR generally which is why I went with client components for everything. I'd definitely like to revisit that though because that's sorta a big point of using Next I think..

Configures jest.
Adds a couple of tests to verify that it can be run and modules could be mocked.
@s2sa4v s2sa4v force-pushed the stas/configure-ui-unit-tests branch from f7088e5 to 7893e1f Compare July 12, 2024 23:15
@s2sa4v s2sa4v requested a review from krishokr July 12, 2024 23:16
@danorlando danorlando merged commit eff4cc6 into main Jul 13, 2024
1 check passed
@danorlando danorlando deleted the stas/configure-ui-unit-tests branch July 13, 2024 17:19
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.

Configure Jest for UI testing
3 participants