mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 03:00:44 +00:00
fix: persist pending onboarding plugin installs
This commit is contained in:
@@ -23,7 +23,10 @@ vi.mock("../plugins/installed-plugin-index-records.js", async (importOriginal) =
|
||||
};
|
||||
});
|
||||
|
||||
import { commitConfigWithPendingPluginInstalls } from "./plugins-install-record-commit.js";
|
||||
import {
|
||||
commitConfigWithPendingPluginInstalls,
|
||||
commitConfigWriteWithPendingPluginInstalls,
|
||||
} from "./plugins-install-record-commit.js";
|
||||
|
||||
describe("commitConfigWithPendingPluginInstalls", () => {
|
||||
beforeEach(() => {
|
||||
@@ -155,4 +158,25 @@ describe("commitConfigWithPendingPluginInstalls", () => {
|
||||
movedInstallRecords: false,
|
||||
});
|
||||
});
|
||||
|
||||
it("supports non-replace config writers without adding an undefined write options argument", async () => {
|
||||
const writeConfigFile = vi.fn(async () => undefined);
|
||||
const nextConfig: OpenClawConfig = {
|
||||
gateway: {
|
||||
mode: "local",
|
||||
},
|
||||
};
|
||||
|
||||
const result = await commitConfigWriteWithPendingPluginInstalls({
|
||||
nextConfig,
|
||||
commit: writeConfigFile,
|
||||
});
|
||||
|
||||
expect(writeConfigFile).toHaveBeenCalledWith(nextConfig);
|
||||
expect(result).toEqual({
|
||||
config: nextConfig,
|
||||
installRecords: {},
|
||||
movedInstallRecords: false,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user