Skip to content

Commit 126d885

Browse files
committed
Add test for multiple rows ctx menu
1 parent e83d192 commit 126d885

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,36 @@ describe('App', () => {
767767
const itemLabels = menuitems.map(item => item.textContent)
768768
expect(itemLabels).toContain('Remove')
769769
})
770+
771+
it('should present the Remove option if multiple checkpoint tip rows are selected', async () => {
772+
render(<App />)
773+
774+
fireEvent(
775+
window,
776+
new MessageEvent('message', {
777+
data: {
778+
data: {
779+
...tableDataFixture,
780+
hasRunningExperiment: false
781+
},
782+
type: MessageToWebviewType.SET_DATA
783+
}
784+
})
785+
)
786+
787+
const firstRow = screen.getByTestId('timestamp___1.exp-e7a67')
788+
fireEvent.click(firstRow)
789+
790+
const secondRow = screen.getByTestId('timestamp___1.test-branch')
791+
fireEvent.click(secondRow)
792+
793+
const target = await screen.findByText('4fb124a')
794+
fireEvent.contextMenu(target, { bubbles: true })
795+
796+
const menuitems = await screen.findAllByRole('menuitem')
797+
const itemLabels = menuitems.map(item => item.textContent)
798+
expect(itemLabels).toContain('Remove Selected Rows')
799+
})
770800
})
771801

772802
describe('Context Menu Suppression', () => {

0 commit comments

Comments
 (0)