
























@@ -31,6 +31,16 @@ function createChannelsSnapshot(name = "saved"): ChannelsStatusSnapshot {
3131};
3232}
333334+function requireConfigSnapshot(
35+host: ChannelsActionHostForTest,
36+): NonNullable<ConfigState["configSnapshot"]> {
37+expect(host.configSnapshot).toBeDefined();
38+if (!host.configSnapshot) {
39+throw new Error("expected config snapshot");
40+}
41+return host.configSnapshot;
42+}
43+3444function createHost(request: ReturnType<typeof vi.fn> = vi.fn()): ChannelsActionHostForTest {
3545return {
3646applySessionKey: "main",
@@ -133,7 +143,7 @@ describe("channel config actions", () => {
133143expect(host.lastError).toContain("Config hash mismatch");
134144expect(host.configFormDirty).toBe(true);
135145expect(host.configForm).toEqual({ gateway: { mode: "local" } });
136-expect(host.configSnapshot?.config).toEqual({ gateway: { mode: "remote" } });
146+expect(requireConfigSnapshot(host).config).toEqual({ gateway: { mode: "remote" } });
137147expect(request.mock.calls.map(([method]) => method)).not.toContain("channels.status");
138148});
139149});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。