@@ -558,7 +558,11 @@ void main() {
558558 group ('MathBlock' , () {
559559 testContentSmoke (ContentExample .mathBlock);
560560
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+
562566 await prepareContent (tester, plainContent (ContentExample .mathBlock.html));
563567 tester.widget (find.text (r'\lambda' , findRichText: true ));
564568 });
@@ -1141,6 +1145,23 @@ void main() {
11411145 testContentSmoke (ContentExample .mathInline);
11421146
11431147 testWidgets ('maintains font-size ratio with surrounding text' , (tester) async {
1148+ const html = '<span class="katex">'
1149+ '<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
1150+ '<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
1151+ '<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>' ;
1152+ await checkFontSizeRatio (tester,
1153+ targetHtml: html,
1154+ targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'λ' ));
1155+ }, skip: true // TODO(#46): adapt this test
1156+ // (it needs a more complex targetFontSizeFinder;
1157+ // see other uses in this file for examples.)
1158+ );
1159+
1160+ testWidgets ('maintains font-size ratio with surrounding text, when showing TeX source' , (tester) async {
1161+ addTearDown (testBinding.reset);
1162+ final globalSettings = testBinding.globalStore.settings;
1163+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
1164+
11441165 const html = '<span class="katex">'
11451166 '<span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>λ</mi></mrow>'
11461167 '<annotation encoding="application/x-tex"> \\ lambda </annotation></semantics></math></span>'
@@ -1150,7 +1171,11 @@ void main() {
11501171 targetFontSizeFinder: mkTargetFontSizeFinderFromPattern (r'\lambda' ));
11511172 });
11521173
1153- testWidgets ('displays KaTeX source; experimental flag default' , (tester) async {
1174+ testWidgets ('displays KaTeX source; experimental flag disabled' , (tester) async {
1175+ addTearDown (testBinding.reset);
1176+ final globalSettings = testBinding.globalStore.settings;
1177+ await globalSettings.setBool (BoolGlobalSetting .renderKatex, false );
1178+
11541179 await prepareContent (tester, plainContent (ContentExample .mathInline.html));
11551180 tester.widget (find.text (r'\lambda' , findRichText: true ));
11561181 });
0 commit comments