fix: guard against duplicate TouchBarItem IDs (#22272)
* feat: Add OtherItemsProxy touchbar item * review! * fix: guard against duplicate TouchBarItem IDs * add spec
This commit is contained in:
parent
12c1d4411d
commit
85ef762269
2 changed files with 15 additions and 0 deletions
|
@ -39,6 +39,14 @@ describe('TouchBar module', () => {
|
|||
}).to.throw('Must only have one OtherItemsProxy per TouchBar')
|
||||
})
|
||||
|
||||
it('throws an error if the same TouchBarItem is added multiple times', () => {
|
||||
expect(() => {
|
||||
const item = new TouchBarLabel({ label: 'Label' })
|
||||
const touchBar = new TouchBar({ items: [item, item] })
|
||||
touchBar.toString()
|
||||
}).to.throw('Cannot add a single instance of TouchBarItem multiple times in a TouchBar')
|
||||
})
|
||||
|
||||
describe('BrowserWindow behavior', () => {
|
||||
let window: BrowserWindow
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue