@@ -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
});
@@ -1098,6 +1102,23 @@ void main() {
1098
1102
});
1099
1103
1100
1104
testWidgets ('maintains font-size ratio with surrounding text, when showing TeX source' , (tester) async {
1105
+ const html = '<span class="katex">'
1106
+ '<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
1107
+ '<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
1108
+ '<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>' ;
1109
+ await checkFontSizeRatio (tester,
1110
+ targetHtml: html,
1111
+ targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'λ' ));
1112
+ }, skip: true // TODO(#46): adapt this test
1113
+ // (it needs a more complex targetFontSizeFinder;
1114
+ // see other uses in this file for examples.)
1115
+ );
1116
+
1117
+ testWidgets ('maintains font-size ratio with surrounding text, when showing TeX source' , (tester) async {
1118
+ addTearDown (testBinding.reset);
1119
+ final globalSettings = testBinding.globalStore.settings;
1120
+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
1121
+
1101
1122
const html = '<span class="katex">'
1102
1123
'<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
1103
1124
'<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
@@ -1107,7 +1128,11 @@ void main() {
1107
1128
targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'\lambda' ));
1108
1129
});
1109
1130
1110
- testWidgets ('displays KaTeX source; experimental flag default' , (tester) async {
1131
+ testWidgets ('displays KaTeX source; experimental flag disabled' , (tester) async {
1132
+ addTearDown (testBinding.reset);
1133
+ final globalSettings = testBinding.globalStore.settings;
1134
+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
1135
+
1111
1136
await prepareContent (tester, plainContent (ContentExample .mathInline.html));
1112
1137
tester.widget (find.text (r'\lambda' , findRichText: true ));
1113
1138
});
0 commit comments