Skip to content

Commit

Permalink
EXM-53137: Fixed TCs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSmarandache15 committed Jul 26, 2024
1 parent 5cbabc4 commit cd57ab0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import com.oxygenxml.git.view.dialog.OKOtherAndCancelDialog;
import com.oxygenxml.git.view.event.GitController;
import com.oxygenxml.git.view.event.PullType;
import com.oxygenxml.git.view.progress.OperationProgressManager;
import com.oxygenxml.git.view.refresh.PanelsRefreshSupport;

import ro.sync.exml.workspace.api.PluginWorkspaceProvider;
Expand Down Expand Up @@ -184,6 +185,9 @@ public Void answer(InvocationOnMock invocation) throws Throwable {
// Dummy icon
Mockito.doReturn(null).when(imageUtilities).loadIcon((URL)Mockito.any());
Mockito.when(pluginWSMock.getImageUtilities()).thenReturn(imageUtilities);

OperationProgressManager.init(new GitController(gitAccess));

}

@Override
Expand Down Expand Up @@ -242,7 +246,6 @@ public void testCheckoutNewBranchWhenRepoInConflict_checkoutConflict_1() throws
writeToFile(new File(SECOND_LOCAL_TEST_REPOSITORY + "/test.txt"), "altfel");;
gitAccess.add(new FileStatus(GitChangeType.ADD, "test.txt"));
gitAccess.commit("commit on ew branch");

// move to main branch
gitAccess.setBranch(GitAccess.DEFAULT_BRANCH_NAME);

Expand All @@ -268,6 +271,7 @@ public void testCheckoutNewBranchWhenRepoInConflict_checkoutConflict_1() throws
abstractAction.actionPerformed(null);
});

((OKOtherAndCancelDialog) findDialog(Tags.REPOSITORY_OUTDATED)).getOKButton().doClick();
JDialog createBranchDialog = findDialog(translator.getTranslation(Tags.CREATE_BRANCH));
JCheckBox checkoutBranchCheckBox = findCheckBox(createBranchDialog, Tags.CHECKOUT_BRANCH);
assertNotNull(checkoutBranchCheckBox);
Expand Down Expand Up @@ -371,6 +375,7 @@ public void testCheckoutNewBranchWhenRepoInConflict_checkoutConflict_2() throws
abstractAction.actionPerformed(null);
});

((OKOtherAndCancelDialog) findDialog(Tags.REPOSITORY_OUTDATED)).getOKButton().doClick();
JDialog createBranchDialog = findDialog(translator.getTranslation(Tags.CREATE_BRANCH));
JCheckBox checkoutBranchCheckBox = findCheckBox(createBranchDialog, Tags.CHECKOUT_BRANCH);
assertNotNull(checkoutBranchCheckBox);
Expand Down Expand Up @@ -504,7 +509,7 @@ public String get() {
}
};

Awaitility.waitAtMost(500, TimeUnit.MILLISECONDS).until(() ->
Awaitility.waitAtMost(1250, TimeUnit.MILLISECONDS).until(() ->
"a_new_day".equals(branchName.get()));

assertEquals("a_new_day", gitAccess.getRepository().getBranch());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import com.oxygenxml.git.view.branches.BranchTreeMenuActionsProvider;
import com.oxygenxml.git.view.event.GitController;
import com.oxygenxml.git.view.event.PullType;
import com.oxygenxml.git.view.progress.OperationProgressManager;
import com.oxygenxml.git.view.refresh.PanelsRefreshSupport;
import com.oxygenxml.git.view.staging.BranchSelectionCombo;

Expand Down Expand Up @@ -190,6 +191,7 @@ protected void setUp() throws Exception {
Mockito.doReturn(imageUtilities).when(pluginWSMock).getImageUtilities();

PluginWorkspaceProvider.setPluginWorkspace(pluginWSMock);
OperationProgressManager.init(new GitController(gitAccess));
}

@Override
Expand Down

0 comments on commit cd57ab0

Please sign in to comment.