@@ -763,6 +763,14 @@ void main() {
763763 });
764764 });
765765
766+ testWidgets ('is italic in italic span' , (tester) async {
767+ // Regression test for: https://github.com/zulip/zulip-flutter/issues/1813
768+ await prepareContent (tester,
769+ plainContent ('<p><em><span class="user-mention" data-user-id="13313">@Chris Bobbe</span></em></p>' ));
770+ final style = mergedStyleOf (tester, '@Chris Bobbe' );
771+ check (style! .fontStyle).equals (FontStyle .italic);
772+ });
773+
766774 testFontWeight ('silent or non-self mention in plain paragraph' ,
767775 expectedWght: 400 ,
768776 // @_**Greg Price**
@@ -1081,7 +1089,19 @@ void main() {
10811089 check (find.textContaining (renderedTextRegexpTwelveHour)).findsOne ();
10821090 });
10831091
1084- void testIconAndTextSameColor (String description, String html) {
1092+ testWidgets ('is italic in italic span' , (tester) async {
1093+ // Regression test for: https://github.com/zulip/zulip-flutter/issues/1813
1094+ await prepareContent (tester,
1095+ // We use the self-account's time-format setting.
1096+ wrapWithPerAccountStoreWidget: true ,
1097+ initialSnapshot: eg.initialSnapshot (),
1098+ plainContent ('<p><em>$timeSpanHtml </em></p>' ));
1099+ final style = mergedStyleOf (tester,
1100+ findAncestor: find.byType (GlobalTime ), renderedTextRegexp);
1101+ check (style! .fontStyle).equals (FontStyle .italic);
1102+ });
1103+
1104+ void testIconAndTextSameColor (String description, String html, {Color ? expectedColor}) {
10851105 testWidgets ('clock icon and text are the same color: $description ' , (tester) async {
10861106 await prepareContent (tester,
10871107 // We use the self-account's time-format setting.
@@ -1097,11 +1117,16 @@ void main() {
10971117 check (textColor).isNotNull ();
10981118
10991119 check (icon).color.isNotNull ().isSameColorAs (textColor! );
1120+ if (expectedColor != null ) {
1121+ check (icon).color.equals (expectedColor);
1122+ }
11001123 });
11011124 }
11021125
11031126 testIconAndTextSameColor ('common case' , '<p>$timeSpanHtml </p>' );
1104- testIconAndTextSameColor ('inside link' , '<p><a href="https://example/">$timeSpanHtml </a></p>' );
1127+ // Regression test for: https://github.com/zulip/zulip-flutter/issues/1819
1128+ testIconAndTextSameColor ('inside link' , '<p><a href="https://example/">$timeSpanHtml </a></p>' ,
1129+ expectedColor: const HSLColor .fromAHSL (1 , 200 , 1 , 0.4 ).toColor ());
11051130
11061131 group ('maintains font-size ratio with surrounding text' , () {
11071132 Future <void > doCheck (WidgetTester tester, double Function (GlobalTime widget) sizeFromWidget) async {
0 commit comments