Loading src/__mocks__/vscode.js +1 −1 Original line number Diff line number Diff line Loading @@ -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(), Loading src/desktop/accounts/auth_flows/oauth_flow.test.ts +1 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading src/desktop/commands/job_actions.test.ts +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'; Loading @@ -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); }); Loading src/desktop/commands/job_actions.ts +2 −0 Original line number Diff line number Diff line Loading @@ -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> { Loading src/desktop/commands/pipeline_actions.test.ts +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'; Loading @@ -14,6 +15,7 @@ describe('retryOrCancelPipeline', () => { }); beforeEach(() => { (vscode.window.withProgress as jest.Mock).mockImplementation((_, task) => task()); jest.mocked(getGitLabService).mockReturnValue(gitLabService); }); Loading Loading
src/__mocks__/vscode.js +1 −1 Original line number Diff line number Diff line Loading @@ -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(), Loading
src/desktop/accounts/auth_flows/oauth_flow.test.ts +1 −0 Original line number Diff line number Diff line Loading @@ -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 { Loading
src/desktop/commands/job_actions.test.ts +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'; Loading @@ -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); }); Loading
src/desktop/commands/job_actions.ts +2 −0 Original line number Diff line number Diff line Loading @@ -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> { Loading
src/desktop/commands/pipeline_actions.test.ts +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'; Loading @@ -14,6 +15,7 @@ describe('retryOrCancelPipeline', () => { }); beforeEach(() => { (vscode.window.withProgress as jest.Mock).mockImplementation((_, task) => task()); jest.mocked(getGitLabService).mockReturnValue(gitLabService); }); Loading