Add button with icon to touch bar spec

This commit is contained in:
Kevin Sawicki 2017-04-18 09:01:43 -07:00
parent c32a723e29
commit ca46d52b0c

View file

@ -1,4 +1,5 @@
const assert = require('assert') const assert = require('assert')
const path = require('path')
const {BrowserWindow, TouchBar} = require('electron').remote const {BrowserWindow, TouchBar} = require('electron').remote
const {closeWindow} = require('./window-helpers') const {closeWindow} = require('./window-helpers')
@ -48,6 +49,11 @@ describe('TouchBar module', function () {
const label = new TouchBarLabel({label: 'bar'}) const label = new TouchBarLabel({label: 'bar'})
const touchBar = new TouchBar([ const touchBar = new TouchBar([
new TouchBarButton({label: 'foo', backgroundColor: '#F00', click: () => {}}), new TouchBarButton({label: 'foo', backgroundColor: '#F00', click: () => {}}),
new TouchBarButton({
icon: path.join(__dirname, 'fixtures', 'assets', 'logo.png'),
iconPosition: 'right',
click: () => {}
}),
new TouchBarColorPicker({selectedColor: '#F00', change: () => {}}), new TouchBarColorPicker({selectedColor: '#F00', change: () => {}}),
new TouchBarGroup({items: new TouchBar([new TouchBarLabel({label: 'hello'})])}), new TouchBarGroup({items: new TouchBar([new TouchBarLabel({label: 'hello'})])}),
label, label,