test: distinguish cron delivery options · openclaw/openclaw@5681cfd
shakkernerd
·
2026-05-13
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -312,10 +312,17 @@ describe("cron view", () => {
|
312 | 312 | container, |
313 | 313 | ); |
314 | 314 | |
315 | | -const options = Array.from(container.querySelectorAll("option")).map((opt) => |
316 | | -(opt.textContent ?? "").trim(), |
317 | | -); |
318 | | -expect(options).toContain("Webhook POST"); |
| 315 | +const deliveryMode = container.querySelector<HTMLSelectElement>("#cron-delivery-mode"); |
| 316 | +expect(Array.from(deliveryMode?.options ?? []).map((opt) => opt.value)).toEqual([ |
| 317 | +"announce", |
| 318 | +"webhook", |
| 319 | +"none", |
| 320 | +]); |
| 321 | +expect(Array.from(deliveryMode?.options ?? []).map((opt) => opt.textContent?.trim())).toEqual([ |
| 322 | +"Announce summary (default)", |
| 323 | +"Webhook POST", |
| 324 | +"None (internal)", |
| 325 | +]); |
319 | 326 | |
320 | 327 | render( |
321 | 328 | renderCron( |
@@ -331,12 +338,16 @@ describe("cron view", () => {
|
331 | 338 | container, |
332 | 339 | ); |
333 | 340 | |
334 | | -const normalizedOptions = Array.from(container.querySelectorAll("option")).map((opt) => |
335 | | -(opt.textContent ?? "").trim(), |
336 | | -); |
337 | | -expect(normalizedOptions).not.toContain("Announce summary (default)"); |
338 | | -expect(normalizedOptions).toContain("Webhook POST"); |
339 | | -expect(normalizedOptions).toContain("None (internal)"); |
| 341 | +const normalizedDeliveryMode = |
| 342 | +container.querySelector<HTMLSelectElement>("#cron-delivery-mode"); |
| 343 | +expect(normalizedDeliveryMode?.value).toBe("none"); |
| 344 | +expect(Array.from(normalizedDeliveryMode?.options ?? []).map((opt) => opt.value)).toEqual([ |
| 345 | +"webhook", |
| 346 | +"none", |
| 347 | +]); |
| 348 | +expect( |
| 349 | +Array.from(normalizedDeliveryMode?.options ?? []).map((opt) => opt.textContent?.trim()), |
| 350 | +).toEqual(["Webhook POST", "None (internal)"]); |
340 | 351 | expect(container.querySelector('input[placeholder="https://example.com/cron"]')).toBeNull(); |
341 | 352 | }); |
342 | 353 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。