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

Refactor TestValidBrowsers. #134

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Conversation

guillermodotn
Copy link
Contributor

Description

This PR refactors the TestValidBrowsers function to improve maintainability and avoid potential conflicts in the future.

Changes Made:

  • Segmented the validBrowsers list based on the operating system (darwin, windows, and linux) using a switch statement.
  • Added error handling to catch unsupported operating systems and immediately fail the test with a clear message.

Rationale

A couple of days ago, I tried to help with PR #133, which was eventually fixed by @dominikschulz. At the same time, I came up with this version that I believe solves the problem in a clean way. As an outsider, I think this new version lets you better identify and extend the test for future modifications.

Signed-off-by: Guillermo N. <guillerm0.n@outlook.es>
Signed-off-by: Guillermo N. <guillerm0.n@outlook.es>
Copy link
Member

@dominikschulz dominikschulz left a comment

Choose a reason for hiding this comment

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

We still have to maintain these lists to stay in sync with the actual config, but that's the point of this test and it will be obvious if the test fails.

Thanks for cleaning this up.

@dominikschulz dominikschulz merged commit e6f6c33 into gopasspw:master Oct 7, 2024
6 checks passed
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