items = []
}
+ this.changeListener = (item) => {
+ this.emit('change', item.id, item.type)
+ }
+
this.windowListeners = {}
this.items = {}
this.ordereredItems = []
this.escapeItem = escapeItem
- this.changeListener = (item) => {
- this.emit('change', item.id, item.type)
- }
const registerItem = (item) => {
this.items[item.id] = item
window.setTouchBar(touchBar)
window.emit('-touch-bar-interaction', {}, button.id)
})
+
+ it('calls the callback on the escape item when a window interaction event fires', function (done) {
+ const button = new TouchBarButton({
+ label: 'bar',
+ click: () => {
+ done()
+ }
+ })
+ const touchBar = new TouchBar({escapeItem: button})
+ window.setTouchBar(touchBar)
+ window.emit('-touch-bar-interaction', {}, button.id)
+ })
})
})