惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
G
Google Developers Blog
aimingoo的专栏
aimingoo的专栏
博客园 - 聂微东
酷 壳 – CoolShell
酷 壳 – CoolShell
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
美团技术团队
博客园_首页
T
Tailwind CSS Blog
博客园 - 三生石上(FineUI控件)
B
Blog
D
DataBreaches.Net
腾讯CDC
C
Check Point Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
U
Unit 42
月光博客
月光博客
V
V2EX
Vercel News
Vercel News
T
The Blog of Author Tim Ferriss
The Cloudflare Blog
博客园 - 叶小钗
Y
Y Combinator Blog

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
refactor: share push test response assertions · openclaw/...
vincentkoc · 2026-06-01 · via Recent Commits to openclaw:main

File tree

  • src/gateway/server-methods

Original file line numberDiff line numberDiff line change

@@ -121,6 +121,16 @@ function firstRespondCall(respond: ReturnType<typeof vi.fn>): RespondCall | unde

121121

return respond.mock.calls[0] as RespondCall | undefined;

122122

}

123123
124+

function expectSuccessfulPushTestResponse(respond: ReturnType<typeof vi.fn>): ApnsPushResult {

125+

expect(sendApnsAlert).toHaveBeenCalledTimes(1);

126+

const call = firstRespondCall(respond);

127+

expect(call?.[0]).toBe(true);

128+

const result = call?.[1] as ApnsPushResult | undefined;

129+

expect(result?.ok).toBe(true);

130+

expect(result?.status).toBe(200);

131+

return result as ApnsPushResult;

132+

}

133+
124134

describe("push.test handler", () => {

125135

beforeEach(() => {

126136

mocks.getRuntimeConfig.mockClear();

@@ -160,12 +170,7 @@ describe("push.test handler", () => {

160170

});

161171

await invoke();

162172
163-

expect(sendApnsAlert).toHaveBeenCalledTimes(1);

164-

const call = firstRespondCall(respond);

165-

expect(call?.[0]).toBe(true);

166-

const result = call?.[1] as ApnsPushResult | undefined;

167-

expect(result?.ok).toBe(true);

168-

expect(result?.status).toBe(200);

173+

expectSuccessfulPushTestResponse(respond);

169174

});

170175
171176

it("sends push test through relay registrations", async () => {

@@ -223,12 +228,7 @@ describe("push.test handler", () => {

223228

},

224229

{ registrationRelayOrigin: undefined },

225230

);

226-

expect(sendApnsAlert).toHaveBeenCalledTimes(1);

227-

const call = firstRespondCall(respond);

228-

expect(call?.[0]).toBe(true);

229-

const result = call?.[1] as ApnsPushResult | undefined;

230-

expect(result?.ok).toBe(true);

231-

expect(result?.status).toBe(200);

231+

const result = expectSuccessfulPushTestResponse(respond);

232232

expect(result?.transport).toBe("relay");

233233

});

234234