Skip to content

Add tests for NetworkButton component #138

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

Merged
merged 3 commits into from
Jan 15, 2023

Conversation

davidlag0
Copy link

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Other (please describe):

This is another PR to keep adding tests to the codebase, for the frontend specifically.

What is the current behavior?

Codebase has no tests. This is meant to improve the situation and ease future code changes.

Issue Number: #135

What is the new behavior?

  • Tests were added for NetworkButton component
  • Because NetworkButton uses code from utils/IP, tests were also added to fully cover these utils to keep the code coverage at 100% for code currently covered by tests.

Does this introduce a breaking change?

  • Yes
  • No

Other information

The specific test files used for snapshots only have been integrated in
each component's test file so that all tests, including the snapshot are
located in a single test file.

Also as more tests were added, it seems like a better idea to have test
data in a separate file on its own rather than import test data from
another test file.

FInally, with all these changes, Jest wanted to have snapshots taken
again thus why the snapshot files were updated too.
@davidlag0 davidlag0 requested a review from dec0dOS as a code owner January 15, 2023 15:50
@davidlag0
Copy link
Author

When adding tests for utils/IP I recalled there is a PR to add IPv6 support. I have noticed that several functions in utils/IP would need to be updated. I have not checked if code has to be updated elsewhere as well for IPv6 support. At least the file is covered with tests now including tests that show IPv6 is not supported with some functions, which should help to make changes to support IPv6!

@dec0dOS
Copy link
Owner

dec0dOS commented Jan 15, 2023

@davidlag0, thanks a lot for your work!
Seems to be everything is fine, ready to merge now.

@dec0dOS dec0dOS merged commit 5190a07 into dec0dOS:test/front_end_tests Jan 15, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants