Skip to content

Commit eefce78

Browse files
committed
fix: update tests to expect i18n keys instead of hardcoded strings
- Update CustomModesManager tests to expect translation keys - Fix YAML edge case tests to match new i18n error messages - All tests now pass with the i18n integration
1 parent 41f03a7 commit eefce78

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/core/config/__tests__/CustomModesManager.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ describe("CustomModesManager", () => {
754754

755755
await manager.deleteCustomMode("non-existent-mode")
756756

757-
expect(mockShowError).toHaveBeenCalledWith(expect.stringContaining("Write error"))
757+
expect(mockShowError).toHaveBeenCalledWith("customModes.errors.deleteFailed")
758758
})
759759
})
760760

src/core/config/__tests__/CustomModesManager.yamlEdgeCases.spec.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -269,9 +269,7 @@ describe("CustomModesManager - YAML Edge Cases", () => {
269269

270270
// Should handle the error gracefully
271271
expect(modes).toHaveLength(0)
272-
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith(
273-
expect.stringContaining("Invalid YAML in .roomodes file"),
274-
)
272+
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("customModes.errors.yamlParseError")
275273
})
276274
})
277275

@@ -292,9 +290,7 @@ describe("CustomModesManager - YAML Edge Cases", () => {
292290

293291
// Should fallback to empty array and show detailed error
294292
expect(modes).toHaveLength(0)
295-
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith(
296-
expect.stringContaining("Invalid YAML in .roomodes file"),
297-
)
293+
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("customModes.errors.yamlParseError")
298294
})
299295

300296
it("should provide schema validation error messages", async () => {
@@ -318,9 +314,7 @@ describe("CustomModesManager - YAML Edge Cases", () => {
318314

319315
// Should show schema validation error
320316
expect(modes).toHaveLength(0)
321-
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith(
322-
expect.stringContaining("Invalid custom modes format"),
323-
)
317+
expect(vscode.window.showErrorMessage).toHaveBeenCalledWith("customModes.errors.schemaValidationError")
324318
})
325319
})
326320

0 commit comments

Comments
 (0)