-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
chore(java): write tests for most of the JavaIconProvider #146
Conversation
574fceb
to
e22b020
Compare
Afaik, this is a bit of an anti-pattern when you create methods just for testing purposes in your production code. Does Kotlin not have visibility levels similar to Java? |
fixed |
src/main/kotlin/com/github/catppuccin/jetbrains_icons/IconProvider.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/catppuccin/jetbrains_icons/IconProvider.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/catppuccin/jetbrains_icons/providers/JavaIconProvider.kt
Outdated
Show resolved
Hide resolved
src/main/kotlin/com/github/catppuccin/jetbrains_icons/settings/views/SettingsHeaderView.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: thelooter <[email protected]>
Signed-off-by: thelooter <[email protected]>
The test case for class with no modifier list is removed along with the mockito-kotlin dependency since it's no longer needed in the test suite.
301a8f7
to
e7f5888
Compare
…reset to before block Signed-off-by: thelooter <[email protected]>
5dafe56
to
0bce453
Compare
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please tidy up test descriptions ("Test" is redundant), and test method names
src/main/kotlin/com/github/catppuccin/jetbrains_icons/providers/JavaIconProvider.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
src/test/kotlin/com/github/com/catppuccin/jetbrains_icons/providers/JavaIconProviderTest.kt
Outdated
Show resolved
Hide resolved
Signed-off-by: thelooter <[email protected]>
c1b3fd1
to
aa59c0f
Compare
Warning
This PR depends on #145 getting merged before
Description
This PR introduces the following changes:
getVisibilityIconForTesting
method in theJavaIconProvider
class to allow accessing thegetVisibilityIcon
method for unit testing purposes.JavaIconProvider
class to cover various scenarios for icon provision, including:PsiClass
or the file is not a Java fileMotivation and Context
The main goal of this PR is to improve the testability of the
JavaIconProvider
class in the Catppuccin JetBrains Icons plugin. The previous implementation did not provide a way to directly test thegetVisibilityIcon
method, which is an important part of the icon provision logic.By adding the internal
getVisibilityIconForTesting
method and creating a comprehensive set of unit tests, we can ensure that the visibility icon provision works as expected, which will improve the overall reliability and maintainability of the plugin.How Has This Been Tested?
This PR includes a new test suite for the
JavaIconProvider
class, which covers the various scenarios mentioned in the description. The tests ensure that the visibility icon provision logic works as expected for different access modifiers.Checklist