@@ -558,7 +558,11 @@ void main() {
558
558
group ('MathBlock' , () {
559
559
testContentSmoke (ContentExample .mathBlock);
560
560
561
- testWidgets ('displays KaTeX source; experimental flag default' , (tester) async {
561
+ testWidgets ('displays KaTeX source; experimental flag disabled' , (tester) async {
562
+ addTearDown (testBinding.reset);
563
+ final globalSettings = testBinding.globalStore.settings;
564
+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
565
+
562
566
await prepareContent (tester, plainContent (ContentExample .mathBlock.html));
563
567
tester.widget (find.text (r'\lambda' , findRichText: true ));
564
568
});
@@ -1102,6 +1106,23 @@ void main() {
1102
1106
});
1103
1107
1104
1108
testWidgets ('maintains font-size ratio with surrounding text, when showing TeX source' , (tester) async {
1109
+ const html = '<span class="katex">'
1110
+ '<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
1111
+ '<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
1112
+ '<span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">λ</span></span></span></span>' ;
1113
+ await checkFontSizeRatio (tester,
1114
+ targetHtml: html,
1115
+ targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'λ' ));
1116
+ }, skip: true // TODO(#46): adapt this test
1117
+ // (it needs a more complex targetFontSizeFinder;
1118
+ // see other uses in this file for examples.)
1119
+ );
1120
+
1121
+ testWidgets ('maintains font-size ratio with surrounding text, when showing TeX source' , (tester) async {
1122
+ addTearDown (testBinding.reset);
1123
+ final globalSettings = testBinding.globalStore.settings;
1124
+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
1125
+
1105
1126
const html = '<span class="katex">'
1106
1127
'<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
1107
1128
'<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
@@ -1111,7 +1132,11 @@ void main() {
1111
1132
targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'\lambda' ));
1112
1133
});
1113
1134
1114
- testWidgets ('displays KaTeX source; experimental flag default' , (tester) async {
1135
+ testWidgets ('displays KaTeX source; experimental flag disabled' , (tester) async {
1136
+ addTearDown (testBinding.reset);
1137
+ final globalSettings = testBinding.globalStore.settings;
1138
+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
1139
+
1115
1140
await prepareContent (tester, plainContent (ContentExample .mathInline.html));
1116
1141
tester.widget (find.text (r'\lambda' , findRichText: true ));
1117
1142
});
0 commit comments