jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/372875 )

Change subject: Add test cases for summary endpoint
......................................................................


Add test cases for summary endpoint

* Show that '.' do not impact summary length
* Show that bolding is retained

Change-Id: Id550eba05ff9d2746834b7802bf5f987aa216e09
---
M test/lib/transformations/summarize.js
1 file changed, 10 insertions(+), 0 deletions(-)

Approvals:
  BearND: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/test/lib/transformations/summarize.js 
b/test/lib/transformations/summarize.js
index b58e3a3..a76110e 100644
--- a/test/lib/transformations/summarize.js
+++ b/test/lib/transformations/summarize.js
@@ -107,6 +107,16 @@
             [
                 '<p>Spain (Spanish: España [esˈpaɲa]), officially the Kingdom 
of Spain (Spanish: Reino de España), is a sovereign state located on the 
Iberian Peninsula in southwestern Europe, with two large archipelagoes, the 
Balearic Islands in the Mediterranean Sea and the Canary Islands off the North 
African Atlantic coast, two cities, Ceuta and Melilla, in the North African 
mainland and several small islands in the Alboran Sea near the Moroccan coast. 
The country\'s mainland is bordered to the south and east by the Mediterranean 
Sea except for a small land boundary with Gibraltar; to the north and northeast 
by France, Andorra, and the Bay of Biscay; and to the west and northwest by 
Portugal and the Atlantic Ocean. It is the only European country to have a 
border with an African country (Morocco) and its African territory accounts for 
nearly 5% of its population, mostly in the Canary Islands but also in Ceuta and 
Melilla</p>',
                 '<p>Spain, officially the Kingdom of Spain, is a sovereign 
state located on the Iberian Peninsula in southwestern Europe, with two large 
archipelagoes, the Balearic Islands in the Mediterranean Sea and the Canary 
Islands off the North African Atlantic coast, two cities, Ceuta and Melilla, in 
the North African mainland and several small islands in the Alboran Sea near 
the Moroccan coast. The country\'s mainland is bordered to the south and east 
by the Mediterranean Sea except for a small land boundary with Gibraltar; to 
the north and northeast by France, Andorra, and the Bay of Biscay; and to the 
west and northwest by Portugal and the Atlantic Ocean. It is the only European 
country to have a border with an African country (Morocco) and its African 
territory accounts for nearly 5% of its population, mostly in the Canary 
Islands but also in Ceuta and Melilla</p>'
+            ],
+            // Full stops do not impact the summary length (T173640)
+            [
+                '<p><a href=\"./Armádní_generál\" title=\"Armádní 
generál\">Arm. gen.</a> <a href=\"./Inženýr\" title=\"Inženýr\">Ing.</a> 
<b>Petr Pavel</b>, <span class=\"new\">M.A.</span>, (*<span>&nbsp;</span><a 
href=\"./1._listopad\" title=\"1. listopad\">1.<span>&nbsp;</span>listopadu</a> 
<a href=\"./1961\" title=\"1961\">1961</a> <a href=\"./Planá\" 
title=\"Planá\">Planá</a>) je <a href=\"./Česko\" title=\"Česko\">český</a> <a 
href=\"./Voják\" title=\"Voják\">voják</a>, <a href=\"./Generál\" 
title=\"Generál\">generál</a> <a href=\"./Armáda_České_republiky\" 
title=\"Armáda České republiky\">Armády České republiky</a> 
a<span>&nbsp;</span>od června 2015 <a 
href=\"./Předseda_vojenského_výboru_NATO\" title=\"Předseda vojenského výboru 
NATO\">předseda vojenského výboru NATO</a>. Jako první zástupce zemí bývalé <a 
href=\"./Varšavská_smlouva\" title=\"Varšavská smlouva\">Varšavské smlouvy</a> 
tak nastoupil do nejvyšší vojenské funkce <a 
href=\"./Severoatlantická_aliance\" title=\"Severoatlantická 
aliance\">Severoatlantické aliance</a>.<span class=\"mw-ref\" 
id=\"cite_ref-nastup_NATO_1-0\"><a 
href=\"./Petr_Pavel#cite_note-nastup_NATO-1\" style=\"counter-reset: mw-Ref 
1;\"><span class=\"mw-reflink-text\">[1]</span></a></span><span 
class=\"mw-ref\" id=\"cite_ref-ihned_2-0\"><a 
href=\"./Petr_Pavel#cite_note-ihned-2\" style=\"counter-reset: mw-Ref 
2;\"><span class=\"mw-reflink-text\">[2]</span></a></span></p>',
+                '<p><span>Arm. gen.</span> <span>Ing.</span> <b>Petr 
Pavel</b>, <span class="new">M.A.</span>, je <span>český</span> 
<span>voják</span>, <span>generál</span> <span>Armády České republiky</span> 
a<span>&nbsp;</span>od června 2015 <span>předseda vojenského výboru 
NATO</span>. Jako první zástupce zemí bývalé <span>Varšavské smlouvy</span> tak 
nastoupil do nejvyšší vojenské funkce <span>Severoatlantické 
aliance</span>.</p>'
+            ],
+            // Bold tags are retained
+            [
+                '<p><b>Vladimír Dlouhý</b> (*<span>&nbsp;</span><a 
href=\"./31._červenec\" title=\"31. červenec\">31. července</a> <a 
href=\"./1953\" title=\"1953\">1953</a> <a href=\"./Praha\" 
title=\"Praha\">Praha</a>) je <a href=\"./Češi\" title=\"Češi\">český</a> <a 
href=\"./Ekonom\" title=\"Ekonom\">ekonom</a> a <a href=\"./Politik\" 
title=\"Politik\">politik</a>, bývalý místopředseda strany <a 
href=\"./Občanská_demokratická_aliance\" title=\"Občanská demokratická 
aliance\">ODA</a> a ministr průmyslu a obchodu v letech <a href=\"./1992\" 
title=\"1992\">1992</a>–<a href=\"./1997\" title=\"1997\">1997</a> ve <a 
href=\"./První_vláda_Václava_Klause\" title=\"První vláda Václava 
Klause\">vládě Václava Klause</a>. V<span>&nbsp;</span>letech <a 
href=\"./1989\" title=\"1989\">1989</a>–<a href=\"./1992\" 
title=\"1992\">1992</a> byl ministrem hospodářství <a 
href=\"./Česká_a_Slovenská_Federativní_Republika\" title=\"Česká a Slovenská 
Federativní Republika\">ČSFR</a>. Nyní působí v&nbsp;soukromé sféře a věnuje se 
poradenské a pedagogické činnosti, v <a href=\"./Květen\" 
title=\"Květen\">květnu</a> <a href=\"./2014\" title=\"2014\">2014</a> byl 
zvolen prezidentem <a href=\"./Hospodářská_komora_České_republiky\" 
title=\"Hospodářská komora České republiky\">Hospodářské komory ČR</a>.</p>',
+                '<p><b>Vladimír Dlouhý</b> je <span>český</span> 
<span>ekonom</span> a <span>politik</span>, bývalý místopředseda strany 
<span>ODA</span> a ministr průmyslu a obchodu v letech 
<span>1992</span>–<span>1997</span> ve <span>vládě Václava Klause</span>. 
V<span>&nbsp;</span>letech <span>1989</span>–<span>1992</span> byl ministrem 
hospodářství <span>ČSFR</span>. Nyní působí v&nbsp;soukromé sféře a věnuje se 
poradenské a pedagogické činnosti, v <span>květnu</span> <span>2014</span> byl 
zvolen prezidentem <span>Hospodářské komory ČR</span>.</p>'
             ]
         ];
         testCases.forEach((test) => {

-- 
To view, visit https://gerrit.wikimedia.org/r/372875
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id550eba05ff9d2746834b7802bf5f987aa216e09
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: BearND <[email protected]>
Gerrit-Reviewer: Dbrant <[email protected]>
Gerrit-Reviewer: Fjalapeno <[email protected]>
Gerrit-Reviewer: GWicke <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Mholloway <[email protected]>
Gerrit-Reviewer: Mhurd <[email protected]>
Gerrit-Reviewer: Mobrovac <[email protected]>
Gerrit-Reviewer: Ppchelko <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to