





















@@ -12,8 +12,8 @@ function getZaloUserCompatibilityNormalizer(): NonNullable<
1212}
13131414describe("zalouser doctor", () => {
15-it("warns when mutable group names rely on disabled name matching", () => {
16-expect(
15+it("warns when mutable group names rely on disabled name matching", async () => {
16+const warnings = await Promise.resolve(
1717zalouserDoctor.collectMutableAllowlistWarnings?.({
1818cfg: {
1919channels: {
@@ -26,13 +26,17 @@ describe("zalouser doctor", () => {
2626},
2727},
2828} as never,
29-}),
30-).toEqual(
31-expect.arrayContaining([
32-expect.stringContaining("mutable allowlist entry across zalouser"),
33-expect.stringContaining("channels.zalouser.groups: group:trusted"),
34-]),
29+}) ?? [],
30+);
31+32+const mutableWarning = warnings.find((warning: string) =>
33+warning.includes("mutable allowlist entry across zalouser"),
3534);
35+const groupPathWarning = warnings.find((warning: string) =>
36+warning.includes("channels.zalouser.groups: group:trusted"),
37+);
38+expect(mutableWarning).toBeDefined();
39+expect(groupPathWarning).toBeDefined();
3640});
37413842it("normalizes legacy group allow aliases to enabled", () => {
@@ -73,11 +77,9 @@ describe("zalouser doctor", () => {
7377).toEqual({
7478enabled: false,
7579});
76-expect(result.changes).toEqual(
77-expect.arrayContaining([
78-"Moved channels.zalouser.groups.group:trusted.allow → channels.zalouser.groups.group:trusted.enabled (true).",
79-"Moved channels.zalouser.accounts.work.groups.group:legacy.allow → channels.zalouser.accounts.work.groups.group:legacy.enabled (false).",
80-]),
81-);
80+expect(result.changes).toEqual([
81+"Moved channels.zalouser.groups.group:trusted.allow → channels.zalouser.groups.group:trusted.enabled (true).",
82+"Moved channels.zalouser.accounts.work.groups.group:legacy.allow → channels.zalouser.accounts.work.groups.group:legacy.enabled (false).",
83+]);
8284});
8385});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。