diff --git a/webview/src/experiments/components/App.test.tsx b/webview/src/experiments/components/App.test.tsx index cd2f6d14c2..1caf3c14ce 100644 --- a/webview/src/experiments/components/App.test.tsx +++ b/webview/src/experiments/components/App.test.tsx @@ -1068,6 +1068,18 @@ describe('App', () => { }) }) + it('should not enable the user to share an experiment whilst an experiment is running', () => { + renderTable() + + const target = screen.getByText('4fb124a') + fireEvent.contextMenu(target, { bubbles: true }) + + advanceTimersByTime(100) + const menuitems = screen.getAllByRole('menuitem') + const itemLabels = menuitems.map(item => item.textContent) + expect(itemLabels).not.toContain('Push') + }) + it('should always present the Plots options if multiple rows are selected', () => { renderTableWithoutRunningExperiments() diff --git a/webview/src/experiments/components/table/body/RowContextMenu.tsx b/webview/src/experiments/components/table/body/RowContextMenu.tsx index f2000e5fcd..ae58915f79 100644 --- a/webview/src/experiments/components/table/body/RowContextMenu.tsx +++ b/webview/src/experiments/components/table/body/RowContextMenu.tsx @@ -211,7 +211,7 @@ const getSingleSelectMenuOptions = ( [id], 'Push', MessageFromWebviewType.PUSH_EXPERIMENT, - isNotExperiment, + isNotExperiment || hasRunningExperiment, true ), ...getRunResumeOptions(