@@ -76,14 +76,17 @@ preferences:
7676 // Step 4: Apply to preferences via setMultipleValues
7777 // $FlowFixMe[underconstrained-implicit-instantiation]
7878 const mockSetMultipleValues = jest . fn ( ) ;
79+ // $FlowFixMe[underconstrained-implicit-instantiation]
80+ const mockSetShortcutForCommand = jest . fn ( ) ;
7981 // $FlowFixMe[incompatible-type] - partial mock
8082 const mockPreferences : Preferences = {
8183 // $FlowFixMe[incompatible-type] - partial mock
8284 values : { } ,
8385 setMultipleValues : mockSetMultipleValues ,
86+ setShortcutForCommand : mockSetShortcutForCommand ,
8487 } ;
8588
86- applyProjectPreferences ( rawPreferences , mockPreferences ) ;
89+ applyProjectPreferences ( { preferences : rawPreferences } , mockPreferences ) ;
8790
8891 expect ( mockSetMultipleValues ) . toHaveBeenCalledWith ( {
8992 autosaveOnPreview : true ,
@@ -99,6 +102,41 @@ preferences:
99102 } ) ;
100103 } ) ;
101104
105+ test ( 'shortcuts from gdevelop-settings.yaml are properly applied to preferences' , ( ) => {
106+ // $FlowFixMe[underconstrained-implicit-instantiation]
107+ const mockSetMultipleValues = jest . fn ( ) ;
108+ // $FlowFixMe[underconstrained-implicit-instantiation]
109+ const mockSetShortcutForCommand = jest . fn ( ) ;
110+ // $FlowFixMe[incompatible-type] - partial mock
111+ const mockPreferences : Preferences = {
112+ // $FlowFixMe[incompatible-type] - partial mock
113+ values : { } ,
114+ setMultipleValues : mockSetMultipleValues ,
115+ setShortcutForCommand : mockSetShortcutForCommand ,
116+ } ;
117+
118+ applyProjectPreferences (
119+ {
120+ shortcuts : {
121+ RELOAD_PROJECT : 'CmdOrCtrl+Shift+R' ,
122+ OPEN_PROJECT_PROPERTIES : 'CmdOrCtrl+Shift+P' ,
123+ } ,
124+ } ,
125+ mockPreferences
126+ ) ;
127+
128+ expect ( mockSetShortcutForCommand ) . toHaveBeenCalledTimes ( 2 ) ;
129+ expect ( mockSetShortcutForCommand ) . toHaveBeenCalledWith (
130+ 'RELOAD_PROJECT' ,
131+ 'CmdOrCtrl+Shift+R'
132+ ) ;
133+ expect ( mockSetShortcutForCommand ) . toHaveBeenCalledWith (
134+ 'OPEN_PROJECT_PROPERTIES' ,
135+ 'CmdOrCtrl+Shift+P'
136+ ) ;
137+ expect ( mockSetMultipleValues ) . not . toHaveBeenCalled ( ) ;
138+ } ) ;
139+
102140 test ( 'readProjectSettings would return null when preferences section is missing' , ( ) => {
103141 const yamlContent = `
104142# Project settings without preferences
0 commit comments