Browse Source

Add initial TouchBarSegmentedControl spec

Kevin Sawicki 8 years ago
parent
commit
3b2faf7b89
1 changed files with 7 additions and 2 deletions
  1. 7 2
      spec/api-touch-bar-spec.js

+ 7 - 2
spec/api-touch-bar-spec.js

@@ -3,7 +3,7 @@ const {BrowserWindow, TouchBar} = require('electron').remote
 const {closeWindow} = require('./window-helpers')
 
 const {TouchBarButton, TouchBarColorPicker, TouchBarGroup} = TouchBar
-const {TouchBarLabel, TouchBarPopover, TouchBarSlider, TouchBarSpacer} = TouchBar
+const {TouchBarLabel, TouchBarPopover, TouchBarSegmentedControl, TouchBarSlider, TouchBarSpacer} = TouchBar
 
 describe('TouchBar module', function () {
   it('throws an error when created without an items array', function () {
@@ -41,7 +41,12 @@ describe('TouchBar module', function () {
         label,
         new TouchBarPopover({items: new TouchBar([new TouchBarButton({label: 'pop'})])}),
         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)
       label.label = 'baz'