@@ -289,7 +289,7 @@ describe('CompassMenu', function () {
289289 }
290290 } ) ;
291291
292- it ( 'should generate a menu template for darwin' , function ( ) {
292+ it ( '[single-connection] should generate a menu template for darwin' , function ( ) {
293293 sinon . stub ( process , 'platform' ) . value ( 'darwin' ) ;
294294 expect ( serializable ( CompassMenu . getTemplate ( 0 ) ) ) . to . deep . equal ( [
295295 {
@@ -373,8 +373,93 @@ describe('CompassMenu', function () {
373373 ] ) ;
374374 } ) ;
375375
376+ it ( '[multiple-connection] should generate a menu template for darwin' , async function ( ) {
377+ await App . preferences . savePreferences ( {
378+ enableNewMultipleConnectionSystem : true ,
379+ } ) ;
380+ sinon . stub ( process , 'platform' ) . value ( 'darwin' ) ;
381+ expect ( serializable ( CompassMenu . getTemplate ( 0 ) ) ) . to . deep . equal ( [
382+ {
383+ label : app . getName ( ) ,
384+ submenu : [
385+ { label : `About ${ app . getName ( ) } ` , role : 'about' } ,
386+ { label : 'Check for updates…' } ,
387+ { type : 'separator' } ,
388+ { label : '&Settings' , accelerator : 'CmdOrCtrl+,' } ,
389+ { type : 'separator' } ,
390+ { label : 'Hide' , accelerator : 'Command+H' , role : 'hide' } ,
391+ {
392+ label : 'Hide Others' ,
393+ accelerator : 'Command+Shift+H' ,
394+ role : 'hideOthers' ,
395+ } ,
396+ { label : 'Show All' , role : 'unhide' } ,
397+ { type : 'separator' } ,
398+ { label : 'Quit' , accelerator : 'CmdOrCtrl+Q' } ,
399+ ] ,
400+ } ,
401+ {
402+ label : '&Connect' ,
403+ submenu : [
404+ { label : '&Import Saved Connections' } ,
405+ { label : '&Export Saved Connections' } ,
406+ ] ,
407+ } ,
408+ {
409+ label : 'Edit' ,
410+ submenu : [
411+ { label : 'Undo' , accelerator : 'Command+Z' , role : 'undo' } ,
412+ { label : 'Redo' , accelerator : 'Shift+Command+Z' , role : 'redo' } ,
413+ { type : 'separator' } ,
414+ { label : 'Cut' , accelerator : 'Command+X' , role : 'cut' } ,
415+ { label : 'Copy' , accelerator : 'Command+C' , role : 'copy' } ,
416+ { label : 'Paste' , accelerator : 'Command+V' , role : 'paste' } ,
417+ {
418+ label : 'Select All' ,
419+ accelerator : 'Command+A' ,
420+ role : 'selectAll' ,
421+ } ,
422+ { type : 'separator' } ,
423+ { label : 'Find' , accelerator : 'CmdOrCtrl+F' } ,
424+ ] ,
425+ } ,
426+ {
427+ label : '&View' ,
428+ submenu : [
429+ { label : '&Reload' , accelerator : 'CmdOrCtrl+Shift+R' } ,
430+ { label : '&Reload Data' , accelerator : 'CmdOrCtrl+R' } ,
431+ { type : 'separator' } ,
432+ { label : 'Actual Size' , accelerator : 'CmdOrCtrl+0' } ,
433+ { label : 'Zoom In' , accelerator : 'CmdOrCtrl+=' } ,
434+ { label : 'Zoom Out' , accelerator : 'CmdOrCtrl+-' } ,
435+ ] ,
436+ } ,
437+ {
438+ label : 'Window' ,
439+ submenu : [
440+ { label : 'New &Window' , accelerator : 'CmdOrCtrl+N' } ,
441+ { label : 'Minimize' , accelerator : 'Command+M' , role : 'minimize' } ,
442+ { label : 'Close' , accelerator : 'Command+Shift+W' , role : 'close' } ,
443+ { type : 'separator' } ,
444+ { label : 'Bring All to Front' , role : 'front' } ,
445+ ] ,
446+ } ,
447+ {
448+ label : '&Help' ,
449+ submenu : [
450+ { label : `&Online ${ app . getName ( ) } Help` , accelerator : 'F1' } ,
451+ { label : '&License' } ,
452+ { label : `&View Source Code on GitHub` } ,
453+ { label : `&Suggest a Feature` } ,
454+ { label : `&Report a Bug` } ,
455+ { label : '&Open Log File' } ,
456+ ] ,
457+ } ,
458+ ] ) ;
459+ } ) ;
460+
376461 [ 'linux' , 'win32' ] . forEach ( ( platform ) => {
377- it ( `should generate a menu template for ${ platform } ` , function ( ) {
462+ it ( `[single-connection] should generate a menu template for ${ platform } ` , function ( ) {
378463 sinon . stub ( process , 'platform' ) . value ( platform ) ;
379464
380465 expect ( serializable ( CompassMenu . getTemplate ( 0 ) ) ) . to . deep . equal ( [
@@ -437,6 +522,70 @@ describe('CompassMenu', function () {
437522 } ,
438523 ] ) ;
439524 } ) ;
525+
526+ it ( `[multiple-connection] should generate a menu template for ${ platform } ` , async function ( ) {
527+ await App . preferences . savePreferences ( {
528+ enableNewMultipleConnectionSystem : true ,
529+ } ) ;
530+ sinon . stub ( process , 'platform' ) . value ( platform ) ;
531+
532+ expect ( serializable ( CompassMenu . getTemplate ( 0 ) ) ) . to . deep . equal ( [
533+ {
534+ label : '&Connect' ,
535+ submenu : [
536+ { label : '&Import Saved Connections' } ,
537+ { label : '&Export Saved Connections' } ,
538+ { type : 'separator' } ,
539+ { label : 'E&xit' , accelerator : 'CmdOrCtrl+Q' } ,
540+ ] ,
541+ } ,
542+ {
543+ label : 'Edit' ,
544+ submenu : [
545+ { label : 'Undo' , accelerator : 'Command+Z' , role : 'undo' } ,
546+ { label : 'Redo' , accelerator : 'Shift+Command+Z' , role : 'redo' } ,
547+ { type : 'separator' } ,
548+ { label : 'Cut' , accelerator : 'Command+X' , role : 'cut' } ,
549+ { label : 'Copy' , accelerator : 'Command+C' , role : 'copy' } ,
550+ { label : 'Paste' , accelerator : 'Command+V' , role : 'paste' } ,
551+ {
552+ label : 'Select All' ,
553+ accelerator : 'Command+A' ,
554+ role : 'selectAll' ,
555+ } ,
556+ { type : 'separator' } ,
557+ { label : 'Find' , accelerator : 'CmdOrCtrl+F' } ,
558+ { type : 'separator' } ,
559+ { label : '&Settings' , accelerator : 'CmdOrCtrl+,' } ,
560+ ] ,
561+ } ,
562+ {
563+ label : '&View' ,
564+ submenu : [
565+ { label : '&Reload' , accelerator : 'CmdOrCtrl+Shift+R' } ,
566+ { label : '&Reload Data' , accelerator : 'CmdOrCtrl+R' } ,
567+ { type : 'separator' } ,
568+ { label : 'Actual Size' , accelerator : 'CmdOrCtrl+0' } ,
569+ { label : 'Zoom In' , accelerator : 'CmdOrCtrl+=' } ,
570+ { label : 'Zoom Out' , accelerator : 'CmdOrCtrl+-' } ,
571+ ] ,
572+ } ,
573+ {
574+ label : '&Help' ,
575+ submenu : [
576+ { label : `&Online ${ app . getName ( ) } Help` , accelerator : 'F1' } ,
577+ { label : '&License' } ,
578+ { label : `&View Source Code on GitHub` } ,
579+ { label : `&Suggest a Feature` } ,
580+ { label : `&Report a Bug` } ,
581+ { label : '&Open Log File' } ,
582+ { type : 'separator' } ,
583+ { label : `&About ${ app . getName ( ) } ` } ,
584+ { label : 'Check for updates…' } ,
585+ ] ,
586+ } ,
587+ ] ) ;
588+ } ) ;
440589 } ) ;
441590
442591 it ( 'should generate a menu template without collection submenu if `showCollection` is `false`' , function ( ) {
0 commit comments