Verified Commit e1dd6adf authored by Enrique Alcántara's avatar Enrique Alcántara 3️⃣
Browse files

fix: Code suggestion gutter icons in Web IDE

parent ec05ab9b
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -71,8 +71,8 @@ describe('CodeSuggestionsGutterIcon', () => {

    it.each`
      state                                  | iconPath
      ${VisibleCodeSuggestionsState.LOADING} | ${'/test/abs/assets/icons/gitlab-code-suggestions-loading.svg'}
      ${VisibleCodeSuggestionsState.ERROR}   | ${'/test/abs/assets/icons/gitlab-code-suggestions-error.svg'}
      ${VisibleCodeSuggestionsState.LOADING} | ${'https://localhost/assets/icons/gitlab-code-suggestions-loading.svg'}
      ${VisibleCodeSuggestionsState.ERROR}   | ${'https://localhost/assets/icons/gitlab-code-suggestions-error.svg'}
    `(
      'when manager state changes to $state, updates decorations to $iconPath',
      ({ state, iconPath }) => {
@@ -105,7 +105,7 @@ describe('CodeSuggestionsGutterIcon', () => {
      mockStateChangeEmitter.fire(VisibleCodeSuggestionsState.READY);

      const loadingDecoration = textEditorDecorationTypeMap.get(
        '/test/abs/assets/icons/gitlab-code-suggestions-loading.svg',
        'https://localhost/assets/icons/gitlab-code-suggestions-loading.svg',
      );

      expect(setDecorationsSpy).toHaveBeenCalledTimes(1);
@@ -122,7 +122,7 @@ describe('CodeSuggestionsGutterIcon', () => {
      );

      const loadingDecoration = textEditorDecorationTypeMap.get(
        '/test/abs/assets/icons/gitlab-code-suggestions-loading.svg',
        'https://localhost/assets/icons/gitlab-code-suggestions-loading.svg',
      );

      expect(setDecorationsSpy).toHaveBeenCalledTimes(2);
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ const createGutterIconDecorations = (context: vscode.ExtensionContext): GutterIc
    status =>
      status &&
      vscode.window.createTextEditorDecorationType({
        gutterIconPath: context.asAbsolutePath(status.path),
        gutterIconPath: vscode.Uri.joinPath(context.extensionUri, status.path),
      }),
  );

+1 −0
Original line number Diff line number Diff line
@@ -52,5 +52,6 @@ export const createExtensionContext = (): vscode.ExtensionContext =>
    secrets: new SecretStorage(),
    extensionPath: '',
    subscriptions: [],
    extensionUri: vscode.Uri.parse('https://localhost'),
    asAbsolutePath: relativePath => `/test/abs/${relativePath}`,
  });