Commit f7539650 authored by Lennard Sprong's avatar Lennard Sprong Committed by Elwyn Benson
Browse files

feat: Display indicator when refreshing sidebar

parent 4ad4c0ce
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ module.exports = {
    showInputBox: jest.fn(),
    showQuickPick: jest.fn(),
    showSaveDialog: jest.fn(),
    withProgress: jest.fn().mockImplementation((opt, callback) => callback()),
    withProgress: jest.fn(),
    createQuickPick: jest.fn(),
    onDidChangeTextEditorSelection: jest.fn(),
    onDidChangeVisibleTextEditors: jest.fn(),
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ describe('OAuthFlow', () => {
      },
    });

    (vscode.window.withProgress as jest.Mock).mockImplementation((_, task) => task());
    jest.mocked(GitLabService.exchangeToken).mockResolvedValue(exchangeToken);
    jest.mocked(GitLabService).mockImplementation(() => {
      return {
+2 −0
Original line number Diff line number Diff line
import vscode from 'vscode';
import { getGitLabService } from '../gitlab/get_gitlab_service';
import { job, projectInRepository } from '../test_utils/entities';
import { GitLabService } from '../gitlab/gitlab_service';
@@ -22,6 +23,7 @@ describe('retryOrCancelJobItemModel', () => {
  const model = new JobItemModel(projectInRepository, job);

  beforeEach(() => {
    (vscode.window.withProgress as jest.Mock).mockImplementation((_, task) => task());
    jest.mocked(getGitLabService).mockReturnValue(gitlabService);
  });

+2 −0
Original line number Diff line number Diff line
@@ -9,9 +9,11 @@ async function retryOrCancelJobItemModel(
): Promise<RestJob | undefined> {
  const { job, projectInRepository } = item;
  const gitlabService = getGitLabService(projectInRepository);
  return vscode.window.withProgress({ location: { viewId: 'currentBranchInfo' } }, async () => {
    const result = await gitlabService.cancelOrRetryJob(action, projectInRepository.project, job);
    if (result) await vscode.commands.executeCommand(USER_COMMANDS.REFRESH_SIDEBAR);
    return result;
  });
}

export function executeJob(item: JobItemModel): Promise<RestJob | undefined> {
+2 −0
Original line number Diff line number Diff line
import vscode from 'vscode';
import { createFakePartial } from '../../common/test_utils/create_fake_partial';
import { getGitLabService } from '../gitlab/get_gitlab_service';
import { GitLabService } from '../gitlab/gitlab_service';
@@ -14,6 +15,7 @@ describe('retryOrCancelPipeline', () => {
  });

  beforeEach(() => {
    (vscode.window.withProgress as jest.Mock).mockImplementation((_, task) => task());
    jest.mocked(getGitLabService).mockReturnValue(gitLabService);
  });

Loading