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

Test/front end tests #158

Open
wants to merge 4 commits into
base: test/front_end_tests
Choose a base branch
from

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): Tests

What is the current behavior?

Issue Number: #135

What is the new behavior?

  • No behavior change. Some production code was adjusted to make testing possible.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Regarding Bar.jsx, I will need help understanding how lines 96, 102, and 137 should run. I was not able to find such cases so I could not build tests to cover these specific lines. Testing is mostly done from the perspective of the user and a bit more deeply for utility functions. If a code path in a frontend component cannot be reached, potential refactoring might be required.

@davidlag0 davidlag0 requested a review from dec0dOS as a code owner June 12, 2023 12:34
@dec0dOS
Copy link
Owner

dec0dOS commented Jun 13, 2023

Thanks for your PR, @davidlag0!

Regarding Bar.jsx, I will need help understanding how lines 96, 102, and 137 should run

Could you write down your question in detail, please? Could not find figure out what is the problem with these lines.

@davidlag0
Copy link
Author

Thanks for your PR, @davidlag0!

Regarding Bar.jsx, I will need help understanding how lines 96, 102, and 137 should run

Could you write down your question in detail, please? Could not find figure out what is the problem with these lines.

Yes, where should I click in the UI to be able to run the code on lines 96, 102 and 137? To run all the other code, for example, I simulate a logged in user and the click on the menu to show the "Log out" choice then click on it, etc. I haven't found how I'm able to use the UI to reach the code paths that would include lines 96, 102 and 137. If there's a way and you can tell me, I will simply write tests catered to these lines. If there is no way to have these lines executed by using the UI, often, it is a sign that refactoring is required, potentially to remove some code that cannot be reached.

Thanks!

@dec0dOS
Copy link
Owner

dec0dOS commented Jun 27, 2023

This code path couldn't be reached now, as it should be used for internal pages that are currently absent:

// TODO: add settings page
// {
// name: "Settings",
// to: "/settings",
// },

The current PR version looks good to me.

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.

2 participants