@@ -763,6 +763,14 @@ void main() {
763
763
});
764
764
});
765
765
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
+
766
774
testFontWeight ('silent or non-self mention in plain paragraph' ,
767
775
expectedWght: 400 ,
768
776
// @_**Greg Price**
@@ -1081,7 +1089,19 @@ void main() {
1081
1089
check (find.textContaining (renderedTextRegexpTwelveHour)).findsOne ();
1082
1090
});
1083
1091
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}) {
1085
1105
testWidgets ('clock icon and text are the same color: $description ' , (tester) async {
1086
1106
await prepareContent (tester,
1087
1107
// We use the self-account's time-format setting.
@@ -1097,11 +1117,16 @@ void main() {
1097
1117
check (textColor).isNotNull ();
1098
1118
1099
1119
check (icon).color.isNotNull ().isSameColorAs (textColor! );
1120
+ if (expectedColor != null ) {
1121
+ check (icon).color.equals (expectedColor);
1122
+ }
1100
1123
});
1101
1124
}
1102
1125
1103
1126
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 ());
1105
1130
1106
1131
group ('maintains font-size ratio with surrounding text' , () {
1107
1132
Future <void > doCheck (WidgetTester tester, double Function (GlobalTime widget) sizeFromWidget) async {
0 commit comments