From f674240f65324932fab1aaa7f7394329058beedf Mon Sep 17 00:00:00 2001 From: Julie G <43496356+julieg18@users.noreply.github.com> Date: Fri, 15 Dec 2023 10:06:33 -0600 Subject: [PATCH] Remove Studio data request failed Toast (#5125) --- extension/src/experiments/data/index.ts | 4 -- .../test/suite/experiments/data/index.test.ts | 39 ------------------- 2 files changed, 43 deletions(-) diff --git a/extension/src/experiments/data/index.ts b/extension/src/experiments/data/index.ts index 5db2f66564..ce7a629f93 100644 --- a/extension/src/experiments/data/index.ts +++ b/extension/src/experiments/data/index.ts @@ -26,7 +26,6 @@ import { COMMITS_SEPARATOR, gitPath } from '../../cli/git/constants' import { getGitPath } from '../../fileSystem' import { ExperimentsModel } from '../model' import { Studio } from '../studio' -import { Toast } from '../../vscode/toast' export class ExperimentsData extends BaseData { private readonly experiments: ExperimentsModel @@ -157,9 +156,6 @@ export class ExperimentsData extends BaseData { }) } catch { this.notifyChanged(defaultData) - void Toast.showError( - `Unable to fetch data from [Studio](${this.studio.getInstanceUrl()}).` - ) } } diff --git a/extension/src/test/suite/experiments/data/index.test.ts b/extension/src/test/suite/experiments/data/index.test.ts index 9f8027005b..c426afb921 100644 --- a/extension/src/test/suite/experiments/data/index.test.ts +++ b/extension/src/test/suite/experiments/data/index.test.ts @@ -35,7 +35,6 @@ import { } from '../../../../data' import { Studio } from '../../../../experiments/studio' import { DEFAULT_STUDIO_URL } from '../../../../setup/webview/contract' -import { Toast } from '../../../../vscode/toast' const MOCK_WORKSPACE_GIT_FOLDER = join(dvcDemoPath, '.mock-git') @@ -410,43 +409,5 @@ suite('Experiments Data Test Suite', () => { } ) }) - - it('should show a toast if the request to Studio fails', async () => { - const mockStudioToken = 'isat_BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB' - const mockSelfHostedStudioUrl = 'https://studio.example.com' - const { data, mockFetch } = buildExperimentsData( - disposable, - '* main', - gitLogFixture, - mockStudioToken, - mockSelfHostedStudioUrl - ) - const mockToast = stub(Toast, 'showError') - - mockFetch.onFirstCall().callsFake(() => { - throw new Error('request failed') - }) - - const requestSent = new Promise(resolve => - data.onDidUpdate(data => { - if (isStudioExperimentsOutput(data)) { - resolve(undefined) - expect(data).to.deep.equal({ - live: [], - pushed: [], - view_url: mockBaseStudioUrl - }) - } - }) - ) - - await data.isReady() - - await requestSent - - expect(mockToast).to.be.calledWithExactly( - `Unable to fetch data from [Studio](${mockSelfHostedStudioUrl}).` - ) - }) }) })