fix(msteams): use valid PascalCase Adaptive Card enums for the welcome heading (#96290)

* fix(msteams): use valid PascalCase Adaptive Card enums for the welcome heading

The welcome card heading TextBlock used weight "bolder" and size "medium"
(lowercase). Adaptive Card TextWeight/TextSize enums are case-sensitive
PascalCase ("Bolder"/"Medium"); Teams falls back to Default for unrecognized
values, so the "Hi! I'm <bot>." greeting rendered unstyled. Use the correct
casing, matching the sibling polls/presentation cards.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(msteams): use valid PascalCase Adaptive Card enums for the welcome heading

---------

Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
ly-wang19
2026-06-24 15:39:38 +08:00
committed by GitHub
parent 74214000bf
commit 9773cbafdb
2 changed files with 13 additions and 2 deletions
@@ -85,6 +85,15 @@ describe("buildWelcomeCard", () => {
expect(actions[0]?.title).toBe("What can you do?");
});
it("styles the heading with valid PascalCase Adaptive Card enum values", () => {
// Lowercase weight/size fall back to Default in the Teams renderer, so the heading must use the
// schema's PascalCase enums to render bold/medium.
const card = buildWelcomeCard();
const heading = (card.body as Array<{ weight?: string; size?: string }>)[0];
expect(heading?.weight).toBe("Bolder");
expect(heading?.size).toBe("Medium");
});
it("uses custom bot name", () => {
const card = buildWelcomeCard({ botName: "TestBot" });
const body = card.body as Array<{ text: string }>;
+4 -2
View File
@@ -31,8 +31,10 @@ export function buildWelcomeCard(options?: WelcomeCardOptions): Record<string, u
{
type: "TextBlock",
text: `Hi! I'm ${botName}.`,
weight: "bolder",
size: "medium",
// Adaptive Card TextWeight/TextSize enums are PascalCase ("Bolder"/"Medium"); lowercase
// values fall back to Default, so the greeting rendered unstyled (matches polls/presentation).
weight: "Bolder",
size: "Medium",
},
{
type: "TextBlock",