Skip to content

Commit 65d76f6

Browse files
RooCodeRooCode
authored andcommitted
Fix localization consistency and add test coverage
- Add missing period to French translation for consistency - Add test case for disabled enableCodeActions setting - Fix existing test mock setup for proper configuration handling
1 parent c99a7af commit 65d76f6

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/activate/__tests__/CodeActionProvider.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,30 @@ describe("CodeActionProvider", () => {
9999
expect(actions).toEqual([])
100100
})
101101

102+
it("should return empty array when enableCodeActions is disabled", () => {
103+
// Mock the configuration to return false for enableCodeActions
104+
const mockGet = vi.fn().mockReturnValue(false)
105+
const mockGetConfiguration = vi.fn().mockReturnValue({
106+
get: mockGet,
107+
})
108+
;(vscode.workspace.getConfiguration as Mock).mockReturnValue(mockGetConfiguration())
109+
110+
const actions = provider.provideCodeActions(mockDocument, mockRange, mockContext)
111+
112+
expect(actions).toEqual([])
113+
expect(vscode.workspace.getConfiguration).toHaveBeenCalledWith("roo-cline")
114+
expect(mockGet).toHaveBeenCalledWith("enableCodeActions", true)
115+
})
116+
102117
it("should handle errors gracefully", () => {
103118
const consoleErrorSpy = vi.spyOn(console, "error").mockImplementation(() => {})
104119

120+
// Reset the workspace mock to return true for enableCodeActions
121+
const mockGet = vi.fn().mockReturnValue(true)
122+
const mockGetConfiguration = vi.fn().mockReturnValue({
123+
get: mockGet,
124+
})
125+
;(vscode.workspace.getConfiguration as Mock).mockReturnValue(mockGetConfiguration())
105126
;(EditorUtils.getEffectiveRange as Mock).mockImplementation(() => {
106127
throw new Error("Test error")
107128
})

src/package.nls.fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@
3131
"settings.vsCodeLmModelSelector.family.description": "La famille du modèle de langage (ex: gpt-4)",
3232
"settings.customStoragePath.description": "Chemin de stockage personnalisé. Laisser vide pour utiliser l'emplacement par défaut. Prend en charge les chemins absolus (ex: 'D:\\RooCodeStorage')",
3333
"settings.rooCodeCloudEnabled.description": "Activer Roo Code Cloud.",
34-
"settings.enableCodeActions.description": "Activer les correctifs rapides de Roo Code"
34+
"settings.enableCodeActions.description": "Activer les correctifs rapides de Roo Code."
3535
}

0 commit comments

Comments
 (0)