File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed
Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,54 @@ Lead
181181 } ) ;
182182} ) ;
183183
184+ describe ( 'getAllSectionPositions(wikicode)' , ( ) => {
185+ test ( 'returns all section positions including -1 values' , ( ) => {
186+ const mopf = new MOSOrderPositionFinder ( ) ;
187+ const wikicode =
188+ `{{Short description|test}}
189+
190+ Lead
191+
192+ == First heading ==
193+ Body
194+
195+ {{Navbox}}` ;
196+ const output = {
197+ top : 0 ,
198+ shortDescription : 0 ,
199+ displayTitle : - 1 ,
200+ hatnotes : - 1 ,
201+ featured : - 1 ,
202+ deletionAndProtection : - 1 ,
203+ maintenanceTags : - 1 ,
204+ engvar : - 1 ,
205+ infoboxes : - 1 ,
206+ languageScriptNeeded : - 1 ,
207+ sidebars : - 1 ,
208+ lead : 28 ,
209+ tableOfContents : - 1 ,
210+ body : 34 ,
211+ worksOrPublications : - 1 ,
212+ seeAlso : - 1 ,
213+ notesAndReferences : - 1 ,
214+ furtherReading : - 1 ,
215+ externalLinks : - 1 ,
216+ successionAndGeographyBoxes : - 1 ,
217+ navboxes : 60 ,
218+ portalBar : - 1 ,
219+ taxonBar : - 1 ,
220+ authorityControl : - 1 ,
221+ geographicalCoordinates : - 1 ,
222+ defaultSort : - 1 ,
223+ categories : - 1 ,
224+ improveCategories : - 1 ,
225+ stubTemplates : - 1 ,
226+ bottom : 70
227+ } ;
228+ expect ( mopf . getAllSectionPositions ( wikicode ) ) . toStrictEqual ( output ) ;
229+ } ) ;
230+ } ) ;
231+
184232describe ( 'getAllExistingSectionPositions(wikicode)' , ( ) => {
185233 test ( 'simple' , ( ) => {
186234 const mopf = new MOSOrderPositionFinder ( ) ;
You can’t perform that action at this time.
0 commit comments