Skip to content

Commit 8e965a8

Browse files
authored
Hide push option when an experiment is running (#3808)
1 parent 4be5704 commit 8e965a8

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

webview/src/experiments/components/App.test.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,18 @@ describe('App', () => {
10681068
})
10691069
})
10701070

1071+
it('should not enable the user to share an experiment whilst an experiment is running', () => {
1072+
renderTable()
1073+
1074+
const target = screen.getByText('4fb124a')
1075+
fireEvent.contextMenu(target, { bubbles: true })
1076+
1077+
advanceTimersByTime(100)
1078+
const menuitems = screen.getAllByRole('menuitem')
1079+
const itemLabels = menuitems.map(item => item.textContent)
1080+
expect(itemLabels).not.toContain('Push')
1081+
})
1082+
10711083
it('should always present the Plots options if multiple rows are selected', () => {
10721084
renderTableWithoutRunningExperiments()
10731085

webview/src/experiments/components/table/body/RowContextMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const getSingleSelectMenuOptions = (
211211
[id],
212212
'Push',
213213
MessageFromWebviewType.PUSH_EXPERIMENT,
214-
isNotExperiment,
214+
isNotExperiment || hasRunningExperiment,
215215
true
216216
),
217217
...getRunResumeOptions(

0 commit comments

Comments
 (0)