




























@@ -95,13 +95,21 @@ describe("createMatrixClient", () => {
9595allowPrivateNetwork: true,
9696});
979798-expect(MatrixClientMock).toHaveBeenCalledWith(
99-"https://matrix.example.org",
100-"tok",
101-expect.objectContaining({
102-ssrfPolicy: { allowPrivateNetwork: true },
103-}),
104-);
98+expect(MatrixClientMock).toHaveBeenCalledWith("https://matrix.example.org", "tok", {
99+userId: "@bot:example.org",
100+password: undefined,
101+deviceId: undefined,
102+encryption: undefined,
103+localTimeoutMs: undefined,
104+initialSyncLimit: undefined,
105+storagePath: undefined,
106+recoveryKeyPath: undefined,
107+idbSnapshotPath: undefined,
108+cryptoDatabasePrefix: undefined,
109+autoBootstrapCrypto: undefined,
110+ssrfPolicy: { allowPrivateNetwork: true },
111+dispatcherPolicy: undefined,
112+});
105113});
106114107115it("prefers explicit ssrfPolicy over allowPrivateNetwork", async () => {
@@ -115,13 +123,21 @@ describe("createMatrixClient", () => {
115123ssrfPolicy: explicitPolicy as never,
116124});
117125118-expect(MatrixClientMock).toHaveBeenCalledWith(
119-"https://matrix.example.org",
120-"tok",
121-expect.objectContaining({
122-ssrfPolicy: explicitPolicy,
123-}),
124-);
126+expect(MatrixClientMock).toHaveBeenCalledWith("https://matrix.example.org", "tok", {
127+userId: "@bot:example.org",
128+password: undefined,
129+deviceId: undefined,
130+encryption: undefined,
131+localTimeoutMs: undefined,
132+initialSyncLimit: undefined,
133+storagePath: undefined,
134+recoveryKeyPath: undefined,
135+idbSnapshotPath: undefined,
136+cryptoDatabasePrefix: undefined,
137+autoBootstrapCrypto: undefined,
138+ssrfPolicy: explicitPolicy,
139+dispatcherPolicy: undefined,
140+});
125141});
126142127143it("leaves ssrfPolicy undefined when allowPrivateNetwork is falsy and no explicit policy", async () => {
@@ -132,13 +148,21 @@ describe("createMatrixClient", () => {
132148persistStorage: false,
133149});
134150135-expect(MatrixClientMock).toHaveBeenCalledWith(
136-"https://matrix.example.org",
137-"tok",
138-expect.objectContaining({
139-ssrfPolicy: undefined,
140-}),
141-);
151+expect(MatrixClientMock).toHaveBeenCalledWith("https://matrix.example.org", "tok", {
152+userId: "@bot:example.org",
153+password: undefined,
154+deviceId: undefined,
155+encryption: undefined,
156+localTimeoutMs: undefined,
157+initialSyncLimit: undefined,
158+storagePath: undefined,
159+recoveryKeyPath: undefined,
160+idbSnapshotPath: undefined,
161+cryptoDatabasePrefix: undefined,
162+autoBootstrapCrypto: undefined,
163+ssrfPolicy: undefined,
164+dispatcherPolicy: undefined,
165+});
142166});
143167144168it("skips persistent storage wiring when persistence is disabled", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。