Add initial TouchBarSegmentedControl spec

This commit is contained in:
Kevin Sawicki 2017-03-10 10:04:22 -08:00
parent 458e4be77c
commit 3b2faf7b89

View file

@ -3,7 +3,7 @@ const {BrowserWindow, TouchBar} = require('electron').remote
const {closeWindow} = require('./window-helpers') const {closeWindow} = require('./window-helpers')
const {TouchBarButton, TouchBarColorPicker, TouchBarGroup} = TouchBar const {TouchBarButton, TouchBarColorPicker, TouchBarGroup} = TouchBar
const {TouchBarLabel, TouchBarPopover, TouchBarSlider, TouchBarSpacer} = TouchBar const {TouchBarLabel, TouchBarPopover, TouchBarSegmentedControl, TouchBarSlider, TouchBarSpacer} = TouchBar
describe('TouchBar module', function () { describe('TouchBar module', function () {
it('throws an error when created without an items array', function () { it('throws an error when created without an items array', function () {
@ -41,7 +41,12 @@ describe('TouchBar module', function () {
label, label,
new TouchBarPopover({items: new TouchBar([new TouchBarButton({label: 'pop'})])}), new TouchBarPopover({items: new TouchBar([new TouchBarButton({label: 'pop'})])}),
new TouchBarSlider({label: 'slide', value: 5, minValue: 2, maxValue: 75, change: () => {}}), new TouchBarSlider({label: 'slide', value: 5, minValue: 2, maxValue: 75, change: () => {}}),
new TouchBarSpacer({size: 'large'}) new TouchBarSpacer({size: 'large'}),
new TouchBarSegmentedControl({
segmentStyle: 'capsule',
segments: [{label: 'baz', enabled: false}],
selectedIndex: 0
})
]) ])
window.setTouchBar(touchBar) window.setTouchBar(touchBar)
label.label = 'baz' label.label = 'baz'