@@ -25,7 +25,7 @@ public async Task SendMessageAsync_BodyOnly_SendsTextOnlyPayload()
2525 }
2626
2727 [ Fact ]
28- public async Task SendMessageAsync_Cards_EmitsAlertTextParagraphAndButtonWidgets ( )
28+ public async Task SendMessageAsync_Cards_EmitsAlertPrefixedTitleTextParagraphAndButtonWidgets ( )
2929 {
3030 var handler = new CapturingHttpMessageHandler ( HttpStatusCode . OK ) ;
3131 var service = CreateService ( handler ) ;
@@ -47,16 +47,15 @@ await service.SendMessageAsync(
4747 var json = await handler . GetRequestJsonAsync ( ) ;
4848
4949 var cardElement = json . GetProperty ( "cardsV2" ) . EnumerateArray ( ) . First ( ) . GetProperty ( "card" ) ;
50- Assert . Equal ( "Deploy failed" , cardElement . GetProperty ( "header" ) . GetProperty ( "title" ) . GetString ( ) ) ;
50+ Assert . Equal ( "🔴 Deploy failed" , cardElement . GetProperty ( "header" ) . GetProperty ( "title" ) . GetString ( ) ) ;
5151 Assert . Equal ( "prod" , cardElement . GetProperty ( "header" ) . GetProperty ( "subtitle" ) . GetString ( ) ) ;
5252
5353 var widgets = cardElement . GetProperty ( "sections" ) . EnumerateArray ( ) . First ( )
5454 . GetProperty ( "widgets" ) . EnumerateArray ( ) . ToList ( ) ;
5555
56- Assert . Equal ( 3 , widgets . Count ) ; // alert accent widget + text paragraph widget + button list
57- Assert . Contains ( "ERROR" , widgets [ 0 ] . GetProperty ( "textParagraph" ) . GetProperty ( "text" ) . GetString ( ) , StringComparison . Ordinal ) ;
58- Assert . Contains ( "more **info**" , widgets [ 1 ] . GetProperty ( "textParagraph" ) . GetProperty ( "text" ) . GetString ( ) , StringComparison . Ordinal ) ;
59- Assert . True ( widgets [ 2 ] . TryGetProperty ( "buttonList" , out _ ) ) ;
56+ Assert . Equal ( 2 , widgets . Count ) ; // text paragraph widget + button list
57+ Assert . Contains ( "more **info**" , widgets [ 0 ] . GetProperty ( "textParagraph" ) . GetProperty ( "text" ) . GetString ( ) , StringComparison . Ordinal ) ;
58+ Assert . True ( widgets [ 1 ] . TryGetProperty ( "buttonList" , out _ ) ) ;
6059 }
6160
6261 [ Fact ]
0 commit comments