@@ -7,6 +7,7 @@ import { CustomModesManager } from "../CustomModesManager"
77import { ModeConfig } from "../../../shared/modes"
88import { fileExistsAtPath } from "../../../utils/fs"
99import { getWorkspacePath , arePathsEqual } from "../../../utils/path"
10+ import { GlobalFileNames } from "../../../shared/globalFileNames"
1011
1112jest . mock ( "vscode" )
1213jest . mock ( "fs/promises" )
@@ -21,7 +22,7 @@ describe("CustomModesManager", () => {
2122
2223 // Use path.sep to ensure correct path separators for the current platform
2324 const mockStoragePath = `${ path . sep } mock${ path . sep } settings`
24- const mockSettingsPath = path . join ( mockStoragePath , "settings" , "cline_custom_modes.json" )
25+ const mockSettingsPath = path . join ( mockStoragePath , "settings" , GlobalFileNames . customModes )
2526 const mockRoomodes = `${ path . sep } mock${ path . sep } workspace${ path . sep } .roomodes`
2627
2728 beforeEach ( ( ) => {
@@ -333,17 +334,16 @@ describe("CustomModesManager", () => {
333334 expect ( mockOnUpdate ) . toHaveBeenCalled ( )
334335 } )
335336 } )
336-
337337 describe ( "File Operations" , ( ) => {
338338 it ( "creates settings directory if it doesn't exist" , async ( ) => {
339- const configPath = path . join ( mockStoragePath , "settings" , "cline_custom_modes.json" )
339+ const settingsPath = path . join ( mockStoragePath , "settings" , GlobalFileNames . customModes )
340340 await manager . getCustomModesFilePath ( )
341341
342- expect ( fs . mkdir ) . toHaveBeenCalledWith ( path . dirname ( configPath ) , { recursive : true } )
342+ expect ( fs . mkdir ) . toHaveBeenCalledWith ( path . dirname ( settingsPath ) , { recursive : true } )
343343 } )
344344
345345 it ( "creates default config if file doesn't exist" , async ( ) => {
346- const configPath = path . join ( mockStoragePath , "settings" , "cline_custom_modes.json" )
346+ const settingsPath = path . join ( mockStoragePath , "settings" , GlobalFileNames . customModes )
347347
348348 // Mock fileExists to return false first time, then true
349349 let firstCall = true
@@ -358,13 +358,13 @@ describe("CustomModesManager", () => {
358358 await manager . getCustomModesFilePath ( )
359359
360360 expect ( fs . writeFile ) . toHaveBeenCalledWith (
361- configPath ,
361+ settingsPath ,
362362 expect . stringMatching ( / ^ \{ \s + " c u s t o m M o d e s " : \s + \[ \s * \] \s * \} $ / ) ,
363363 )
364364 } )
365365
366366 it ( "watches file for changes" , async ( ) => {
367- const configPath = path . join ( mockStoragePath , "settings" , "cline_custom_modes.json" )
367+ const configPath = path . join ( mockStoragePath , "settings" , GlobalFileNames . customModes )
368368
369369 ; ( fs . readFile as jest . Mock ) . mockResolvedValue ( JSON . stringify ( { customModes : [ ] } ) )
370370 ; ( arePathsEqual as jest . Mock ) . mockImplementation ( ( path1 : string , path2 : string ) => {
0 commit comments