-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Add unit test to four test classes #7651
Conversation
when(undoManager.addEdit(mock(NamedCompound.class))).thenReturn(true); | ||
|
||
duplicateSearch.execute(); | ||
verify(dialogService, times(1)).notify(Localization.lang("Searching for duplicates...")); |
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.
Hi :)
I saw on the discussion #7636 that you would prefer using any() over a localized argument for the notify() method. The rationale for using this localized argument was to verify if dialogService shows the correct message for each condition. As @ningxie1991 pointed out, would the dialogService somehow loose its purpose when using any() as the argument?
Moreover, in this case, if I use the localized argument, both very() methods work, but by using any() as argument I receive the feedback that the dialogService got invoked only once. So, what did I miss on here?
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.
It's okay to use the correct localization argument. I think we thought that it just verifies the numbers of calls, but not the content
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.
Some minor improvements, but overall looks good to me so far
src/test/java/org/jabref/gui/edit/ManageKeywordsViewModelTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/gui/edit/ManageKeywordsViewModelTest.java
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.
Small nitpick comments to have the tests indepdenent of the user's configuration.
I am not sure about the benefit of these tests. It tests some GUI functionality, but not some logic functionality. Therefore, I added to #6207 that we do not want to have any GUI tests added as they are not simple at all.
src/test/java/org/jabref/gui/duplicationFinder/DuplicateSearchTest.java
Outdated
Show resolved
Hide resolved
src/test/java/org/jabref/gui/edit/ManageKeywordsViewModelTest.java
Outdated
Show resolved
Hide resolved
Made private constructor package-private to be able to create a GroupDiff instance for testing. The test fails when comparing the Optional<GroupDiff> objects directly due to the different object IDs, despite the fact that their fields should be identical. Therefore, I decided to compare the fields of the objects to check if they are equal.
Moved setup of Globals.prefs into the setupGlobals() method
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
Hi, |
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.
Hi @BShaq , we were just looking in all of our open PRs and saw yours. Did you have some time to look into the failing test already? |
Hi @calixtus & @koppor . I'm very sorry that it takes so long to reply to all of your comments, it has been a busy few weeks for me.. |
Same for us 😇
May I ask whether you ran all tests? I get the following output:
I fixed that in
No, the warning is OK |
Co-authored-by: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com>
* upstream/main: (26 commits) Add unit test to four test classes (#7651) Fix IEEE test (#7852) New Crowdin updates (#7859) Fix markdown syntax of ADRs add missing l10n (#7857) New Crowdin updates (#7847) Bump mockito-core from 3.11.1 to 3.11.2 (#7856) Bump checkstyle from 8.43 to 8.44 (#7855) Fix for issue #4652: Add Find Unlinked Files Filter based on Date (#7846) Fix for entering a backslash in the custom entry preview dialog (#7851) Fixed INSPIREFetcherTest Fixed TitleFetcherTest Ignore baeldung.com and tldrlegal.com from out link checks New Crowdin updates (#7845) New Crowdin updates (#7843) Refactoring and addition of unit tests (#7597) CLI option to write XMP metadata to pdfs (#7814) Add query validation for web search (#7809) change eclipse default output dir (#7842) Bump lucene-queryparser from 8.8.2 to 8.9.0 (#7835) ...
…kflow-for-slr-search * upstream/main: (31 commits) New translations JabRef_en.properties (German) (#7868) Fix test "higherTrustLevelWins()" (#7866) Change WM_CLASS to jabref (#7858) [Bot] Update CSL styles (#7865) Add unit test to four test classes (#7651) Fix IEEE test (#7852) New Crowdin updates (#7859) Fix markdown syntax of ADRs add missing l10n (#7857) New Crowdin updates (#7847) Bump mockito-core from 3.11.1 to 3.11.2 (#7856) Bump checkstyle from 8.43 to 8.44 (#7855) Fix for issue #4652: Add Find Unlinked Files Filter based on Date (#7846) Fix for entering a backslash in the custom entry preview dialog (#7851) Fixed INSPIREFetcherTest Fixed TitleFetcherTest Ignore baeldung.com and tldrlegal.com from out link checks New Crowdin updates (#7845) New Crowdin updates (#7843) Refactoring and addition of unit tests (#7597) ... # Conflicts: # src/main/resources/l10n/JabRef_en.properties
This pull request contributes to issue #6207, which is to add more unit tests to the project.
Tests added:
DuplicateSearchTest
ManageKeywordsViewModelTest
GroupDiffTest
Tests extended:
GroupTreeNodeTest
CHANGELOG.md
described in a way that is understandable for the average user (if applicable)