mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 14:10:51 +00:00
test(e2e): harden beta preflight failures
This commit is contained in:
@@ -1708,14 +1708,16 @@ describe("doctor config flow", () => {
|
||||
const cfg = result.cfg as unknown as {
|
||||
channels: { discord: { dm: { allowFrom: string[] }; allowFrom?: string[] } };
|
||||
};
|
||||
// When dmPolicy is set at top level but allowFrom only exists nested in dm,
|
||||
// the repair adds "*" to dm.allowFrom
|
||||
if (cfg.channels.discord.dm) {
|
||||
// Top-level allowFrom is canonical for Discord; nested dm.allowFrom is
|
||||
// preserved when it already carried sender ids.
|
||||
if (cfg.channels.discord.allowFrom) {
|
||||
expect(cfg.channels.discord.allowFrom).toContain("*");
|
||||
expect(cfg.channels.discord.dm?.allowFrom).toContain("123");
|
||||
} else if (cfg.channels.discord.dm) {
|
||||
expect(cfg.channels.discord.dm.allowFrom).toContain("*");
|
||||
expect(cfg.channels.discord.dm.allowFrom).toContain("123");
|
||||
} else {
|
||||
// If doctor flattened the config, allowFrom should be at top level
|
||||
expect(cfg.channels.discord.allowFrom).toContain("*");
|
||||
expect.unreachable("expected Discord repair to preserve a DM allowFrom location");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user