Skip to content

Commit 2f45c2c

Browse files
committed
MOSOrderPositionFinder: add tests
1 parent 9521b47 commit 2f45c2c

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

SpeciesHelper/tests/MOSOrderPositionFinder.test.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
184232
describe( 'getAllExistingSectionPositions(wikicode)', () => {
185233
test( 'simple', () => {
186234
const mopf = new MOSOrderPositionFinder();

0 commit comments

Comments
 (0)