fix(regression): persist auto-enabled channel auth config

This commit is contained in:
Tak Hoffman
2026-03-27 23:45:43 -05:00
parent 8539886cd8
commit 46ab177743
2 changed files with 24 additions and 6 deletions

View File

@@ -158,6 +158,22 @@ describe("channel-auth", () => {
channelInput: "whatsapp",
}),
);
expect(mocks.writeConfigFile).toHaveBeenCalledWith(autoEnabledCfg);
});
it("persists auto-enabled config during logout auto-pick too", async () => {
const autoEnabledCfg = { channels: { whatsapp: {} }, plugins: { allow: ["whatsapp"] } };
mocks.loadConfig.mockReturnValue({});
mocks.applyPluginAutoEnable.mockReturnValue({ config: autoEnabledCfg, changes: ["whatsapp"] });
await runChannelLogout({}, runtime);
expect(mocks.logoutAccount).toHaveBeenCalledWith(
expect.objectContaining({
cfg: autoEnabledCfg,
}),
);
expect(mocks.writeConfigFile).toHaveBeenCalledWith(autoEnabledCfg);
});
it("ignores configured channels that do not support login when channel is omitted", async () => {