Loading desktop.package.json +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,11 @@ "title": "Remove Account from VS Code", "category": "GitLab" }, { "command": "gl.validateAccounts", "title": "Validate GitLab Accounts", "category": "GitLab" }, { "command": "gl.showIssuesAssignedToMe", "title": "Show Issues Assigned to Me", Loading src/__mocks__/vscode.js +3 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,9 @@ module.exports = { this.supportThemeIcons = supportThemeIcons; }, Uri, authentication: { getSession: jest.fn(), }, comments: { createCommentController: jest.fn(), }, Loading src/common/errors/handle_error.test.ts +12 −2 Original line number Diff line number Diff line Loading @@ -42,13 +42,23 @@ describe('handleError', () => { expect(executeCommand).toBeCalledWith(COMMAND_SHOW_OUTPUT); }); it('shows UI error', async () => { describe('when handling an UI Error', () => { let showUiMock: jest.Func; beforeEach(() => { const error = new Error('test'); const showUiMock = jest.fn().mockResolvedValueOnce(undefined); showUiMock = jest.fn().mockResolvedValueOnce(undefined); const testError: UiError = { ...error, showUi: showUiMock }; handleError(testError); }); it('shows UI error', async () => { expect(showUiMock).toHaveBeenCalled(); }); it('does not show the generic error UI', async () => { expect(vscode.window.showErrorMessage).not.toHaveBeenCalled(); }); }); }); src/common/errors/handle_error.ts +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ export const handleError = (e: Error): void => { log.error(e); if (isUiError(e)) { e.showUi().catch(log.error); return; } const showErrorMessage = async () => { const choice = await vscode.window.showErrorMessage(e.message, 'Show Logs'); Loading src/desktop/command_names.ts +1 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ export const USER_COMMANDS = { ADD_ACCOUNT: 'gl.addAccount', REMOVE_ACCOUNT: 'gl.removeAccount', VALIDATE_ACCOUNTS: 'gl.validateAccounts', SHOW_ISSUES_ASSIGNED_TO_ME: 'gl.showIssuesAssignedToMe', SHOW_MERGE_REQUESTS_ASSIGNED_TO_ME: 'gl.showMergeRequestsAssignedToMe', OPEN_ACTIVE_FILE: 'gl.openActiveFile', Loading Loading
desktop.package.json +5 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,11 @@ "title": "Remove Account from VS Code", "category": "GitLab" }, { "command": "gl.validateAccounts", "title": "Validate GitLab Accounts", "category": "GitLab" }, { "command": "gl.showIssuesAssignedToMe", "title": "Show Issues Assigned to Me", Loading
src/__mocks__/vscode.js +3 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,9 @@ module.exports = { this.supportThemeIcons = supportThemeIcons; }, Uri, authentication: { getSession: jest.fn(), }, comments: { createCommentController: jest.fn(), }, Loading
src/common/errors/handle_error.test.ts +12 −2 Original line number Diff line number Diff line Loading @@ -42,13 +42,23 @@ describe('handleError', () => { expect(executeCommand).toBeCalledWith(COMMAND_SHOW_OUTPUT); }); it('shows UI error', async () => { describe('when handling an UI Error', () => { let showUiMock: jest.Func; beforeEach(() => { const error = new Error('test'); const showUiMock = jest.fn().mockResolvedValueOnce(undefined); showUiMock = jest.fn().mockResolvedValueOnce(undefined); const testError: UiError = { ...error, showUi: showUiMock }; handleError(testError); }); it('shows UI error', async () => { expect(showUiMock).toHaveBeenCalled(); }); it('does not show the generic error UI', async () => { expect(vscode.window.showErrorMessage).not.toHaveBeenCalled(); }); }); });
src/common/errors/handle_error.ts +1 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ export const handleError = (e: Error): void => { log.error(e); if (isUiError(e)) { e.showUi().catch(log.error); return; } const showErrorMessage = async () => { const choice = await vscode.window.showErrorMessage(e.message, 'Show Logs'); Loading
src/desktop/command_names.ts +1 −0 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ export const USER_COMMANDS = { ADD_ACCOUNT: 'gl.addAccount', REMOVE_ACCOUNT: 'gl.removeAccount', VALIDATE_ACCOUNTS: 'gl.validateAccounts', SHOW_ISSUES_ASSIGNED_TO_ME: 'gl.showIssuesAssignedToMe', SHOW_MERGE_REQUESTS_ASSIGNED_TO_ME: 'gl.showMergeRequestsAssignedToMe', OPEN_ACTIVE_FILE: 'gl.openActiveFile', Loading