fix(msteams): use valid PascalCase Adaptive Card enums for the welcom… · openclaw/openclaw@9773cba
ly-wang19
·
2026-06-24
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -85,6 +85,15 @@ describe("buildWelcomeCard", () => {
|
85 | 85 | expect(actions[0]?.title).toBe("What can you do?"); |
86 | 86 | }); |
87 | 87 | |
| 88 | +it("styles the heading with valid PascalCase Adaptive Card enum values", () => { |
| 89 | +// Lowercase weight/size fall back to Default in the Teams renderer, so the heading must use the |
| 90 | +// schema's PascalCase enums to render bold/medium. |
| 91 | +const card = buildWelcomeCard(); |
| 92 | +const heading = (card.body as Array<{ weight?: string; size?: string }>)[0]; |
| 93 | +expect(heading?.weight).toBe("Bolder"); |
| 94 | +expect(heading?.size).toBe("Medium"); |
| 95 | +}); |
| 96 | + |
88 | 97 | it("uses custom bot name", () => { |
89 | 98 | const card = buildWelcomeCard({ botName: "TestBot" }); |
90 | 99 | const body = card.body as Array<{ text: string }>; |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -31,8 +31,10 @@ export function buildWelcomeCard(options?: WelcomeCardOptions): Record<string, u
|
31 | 31 | { |
32 | 32 | type: "TextBlock", |
33 | 33 | text: `Hi! I'm ${botName}.`, |
34 | | -weight: "bolder", |
35 | | -size: "medium", |
| 34 | +// Adaptive Card TextWeight/TextSize enums are PascalCase ("Bolder"/"Medium"); lowercase |
| 35 | +// values fall back to Default, so the greeting rendered unstyled (matches polls/presentation). |
| 36 | +weight: "Bolder", |
| 37 | +size: "Medium", |
36 | 38 | }, |
37 | 39 | { |
38 | 40 | type: "TextBlock", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。