(action: () => void)
| 6 | import * as UI from '../ui/legacy/legacy.js'; |
| 7 | |
| 8 | export function getMenu(action: () => void): UI.ContextMenu.ContextMenu { |
| 9 | const sandbox = sinon.createSandbox(); |
| 10 | |
| 11 | const contextMenuShow = sandbox.stub(UI.ContextMenu.ContextMenu.prototype, 'show').resolves(); |
| 12 | action(); |
| 13 | sandbox.restore(); |
| 14 | return contextMenuShow.thisValues[0]; |
| 15 | } |
| 16 | |
| 17 | export function getMenuForToolbarButton(button: UI.Toolbar.ToolbarMenuButton): UI.ContextMenu.ContextMenu { |
| 18 | return getMenu(() => { |
no test coverage detected