Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions src/core/config/__tests__/importExport.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@ describe("importExport", () => {

it("should export settings to the selected file location", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

const mockProviderProfiles = {
Expand All @@ -1383,15 +1383,15 @@ describe("importExport", () => {
expect(mockContextProxy.export).toHaveBeenCalled()
expect(fs.mkdir).toHaveBeenCalledWith("/mock/path", { recursive: true })

expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/roo-code-settings.json", {
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/zoo-code-settings.json", {
providerProfiles: mockProviderProfiles,
globalSettings: mockGlobalSettings,
})
})

it("should include globalSettings when allowedMaxRequests is null", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

const mockProviderProfiles = {
Expand All @@ -1415,15 +1415,15 @@ describe("importExport", () => {
contextProxy: mockContextProxy,
})

expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/roo-code-settings.json", {
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/zoo-code-settings.json", {
providerProfiles: mockProviderProfiles,
globalSettings: mockGlobalSettings,
})
})

it("should handle errors during the export process", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

mockProviderSettingsManager.export.mockResolvedValue({
Expand Down Expand Up @@ -1453,7 +1453,7 @@ describe("importExport", () => {

it("should handle errors during directory creation", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

mockProviderSettingsManager.export.mockResolvedValue({
Expand Down Expand Up @@ -1490,13 +1490,13 @@ describe("importExport", () => {
defaultUri: expect.anything(),
})

expect(vscode.Uri.file).toHaveBeenCalledWith(path.join("/mock/home", "Downloads", "roo-code-settings.json"))
expect(vscode.Uri.file).toHaveBeenCalledWith(path.join("/mock/home", "Downloads", "zoo-code-settings.json"))
})

describe("codebase indexing export", () => {
it("should export correct base URL for OpenAI Compatible provider", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

const mockProviderProfiles = {
Expand Down Expand Up @@ -1538,15 +1538,15 @@ describe("importExport", () => {
contextProxy: mockContextProxy,
})

expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/roo-code-settings.json", {
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/zoo-code-settings.json", {
providerProfiles: mockProviderProfiles,
globalSettings: mockGlobalSettings,
})
})

it("should export model dimension for OpenAI Compatible provider", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

const mockProviderProfiles = {
Expand Down Expand Up @@ -1593,7 +1593,7 @@ describe("importExport", () => {

it("should not mix settings between different providers", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

const mockProviderProfiles = {
Expand Down Expand Up @@ -1653,7 +1653,7 @@ describe("importExport", () => {

it("should handle missing provider-specific settings gracefully", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

const mockProviderProfiles = {
Expand Down Expand Up @@ -1691,15 +1691,15 @@ describe("importExport", () => {
})

// Should not throw an error and should preserve original settings
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/roo-code-settings.json", {
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/zoo-code-settings.json", {
providerProfiles: mockProviderProfiles,
globalSettings: mockGlobalSettings, // Should remain unchanged
})
})

it("should maintain backward compatibility with existing exports", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

const mockProviderProfiles = {
Expand Down Expand Up @@ -1734,15 +1734,15 @@ describe("importExport", () => {
})

// Should not modify settings for non-openai-compatible providers
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/roo-code-settings.json", {
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/zoo-code-settings.json", {
providerProfiles: mockProviderProfiles,
globalSettings: mockGlobalSettings, // Should remain unchanged
})
})

it("should handle missing current provider gracefully", async () => {
;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

const mockProviderProfiles = {
Expand Down Expand Up @@ -1779,7 +1779,7 @@ describe("importExport", () => {
})

// Should not throw an error and should preserve original settings
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/roo-code-settings.json", {
expect(safeWriteJson).toHaveBeenCalledWith("/mock/path/zoo-code-settings.json", {
providerProfiles: mockProviderProfiles,
globalSettings: mockGlobalSettings, // Should remain unchanged
})
Expand Down Expand Up @@ -2452,7 +2452,7 @@ describe("importExport", () => {
// when the OpenAI Compatible settings are stored in global state via contextProxy

;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

// Set up provider profiles - note that the OpenAI Compatible provider does NOT have
Expand Down Expand Up @@ -2526,7 +2526,7 @@ describe("importExport", () => {
// Using deepseek provider which uses apiModelId and has supportsReasoningBudget: false

;(vscode.window.showSaveDialog as Mock).mockResolvedValue({
fsPath: "/mock/path/roo-code-settings.json",
fsPath: "/mock/path/zoo-code-settings.json",
})

// Use a real ProviderSettingsManager instance to test the actual filtering logic
Expand Down
4 changes: 2 additions & 2 deletions src/core/config/importExport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ export async function importSettingsFromPath(
*/
export const importSettings = async ({ providerSettingsManager, contextProxy, customModesManager }: ImportOptions) => {
// Use the last export path as a sensible default, falling back to Downloads
const defaultUri = resolveDefaultSaveUri(contextProxy, "lastSettingsExportPath", "roo-code-settings.json", {
const defaultUri = resolveDefaultSaveUri(contextProxy, "lastSettingsExportPath", "zoo-code-settings.json", {
useWorkspace: false,
fallbackDir: path.join(os.homedir(), "Downloads"),
})
Expand Down Expand Up @@ -310,7 +310,7 @@ export const importSettingsFromFile = async (
}

export const exportSettings = async ({ providerSettingsManager, contextProxy }: ExportOptions) => {
const defaultUri = await resolveDefaultSaveUri(contextProxy, "lastSettingsExportPath", "roo-code-settings.json", {
const defaultUri = await resolveDefaultSaveUri(contextProxy, "lastSettingsExportPath", "zoo-code-settings.json", {
useWorkspace: false,
fallbackDir: path.join(os.homedir(), "Downloads"),
})
Expand Down
2 changes: 1 addition & 1 deletion src/package.nls.ca.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.nls.de.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.nls.es.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.nls.fr.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.nls.hi.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/package.nls.id.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading