diff --git a/extension/src/experiments/webview/messages.ts b/extension/src/experiments/webview/messages.ts index 72eddba0c4..db691e39fa 100644 --- a/extension/src/experiments/webview/messages.ts +++ b/extension/src/experiments/webview/messages.ts @@ -124,7 +124,7 @@ export class WebviewMessages { return this.focusSortsTree() case MessageFromWebviewType.OPEN_PLOTS_WEBVIEW: - return this.showPlots() + return this.showPlotsToSide() case MessageFromWebviewType.SHARE_EXPERIMENT_AS_BRANCH: return commands.executeCommand( @@ -143,7 +143,7 @@ export class WebviewMessages { case MessageFromWebviewType.SET_EXPERIMENTS_AND_OPEN_PLOTS: return Promise.all([ this.setSelectedExperiments(message.payload), - this.showPlots() + this.showPlotsToSide() ]) case MessageFromWebviewType.SET_EXPERIMENTS_HEADER_HEIGHT: { @@ -316,7 +316,10 @@ export class WebviewMessages { ) } - private showPlots() { - return commands.executeCommand(RegisteredCommands.PLOTS_SHOW, this.dvcRoot) + private showPlotsToSide() { + return commands.executeCommand( + RegisteredCommands.EXPERIMENT_AND_PLOTS_SHOW, + this.dvcRoot + ) } } diff --git a/extension/src/test/suite/experiments/index.test.ts b/extension/src/test/suite/experiments/index.test.ts index 9df0b00575..1ed99ce698 100644 --- a/extension/src/test/suite/experiments/index.test.ts +++ b/extension/src/test/suite/experiments/index.test.ts @@ -1015,10 +1015,14 @@ suite('Experiments Test Suite', () => { it('should be able to handle a message to compare experiments plots', async () => { const { experiments, experimentsModel } = buildExperiments(disposable) - const mockShowPlots = stub( - WorkspacePlots.prototype, - 'showWebview' - ).resolves(undefined) + const mockShowPlots = stub(WorkspacePlots.prototype, 'showWebview') + + const dataSent = new Promise(resolve => + mockShowPlots.callsFake(() => { + resolve(undefined) + return Promise.resolve(undefined) + }) + ) await experiments.isReady() @@ -1039,7 +1043,7 @@ suite('Experiments Test Suite', () => { type: MessageFromWebviewType.SET_EXPERIMENTS_AND_OPEN_PLOTS }) - await tableChangePromise + await Promise.all([tableChangePromise, dataSent]) const selectExperimentIds = experimentsModel .getSelectedRevisions()