-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Change placement order at RMTR * Fix newline issues * level 4 heading * add tests, always add exactly 1 empty line * comment --------- Co-authored-by: NovemLinguae <[email protected]>
- Loading branch information
1 parent
466443f
commit 7133c38
Showing
3 changed files
with
123 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
describe('modules/twinklexfd', () => { | ||
describe('insertRMTR', () => { | ||
test('0 rows, 1 line breaks', () => { | ||
const pageWikitext = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
==== Requests to revert undiscussed moves ====`; | ||
const wikitextToInsert = `* {{RMassist/core}}`; | ||
const expected = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core}} | ||
==== Requests to revert undiscussed moves ====`; | ||
expect(Twinkle.xfd.insertRMTR(pageWikitext, wikitextToInsert)).toBe(expected); | ||
}); | ||
|
||
test('0 rows, 1 line breaks', () => { | ||
const pageWikitext = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
==== Requests to revert undiscussed moves ====`; | ||
const wikitextToInsert = `* {{RMassist/core}}`; | ||
const expected = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core}} | ||
==== Requests to revert undiscussed moves ====`; | ||
expect(Twinkle.xfd.insertRMTR(pageWikitext, wikitextToInsert)).toBe(expected); | ||
}); | ||
|
||
test('0 rows, 2 line breaks', () => { | ||
const pageWikitext = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
==== Requests to revert undiscussed moves ====`; | ||
const wikitextToInsert = `* {{RMassist/core}}`; | ||
const expected = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core}} | ||
==== Requests to revert undiscussed moves ====`; | ||
expect(Twinkle.xfd.insertRMTR(pageWikitext, wikitextToInsert)).toBe(expected); | ||
}); | ||
|
||
test('1 rows, 0 line breaks', () => { | ||
const pageWikitext = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core2}} | ||
==== Requests to revert undiscussed moves ====`; | ||
const wikitextToInsert = `* {{RMassist/core}}`; | ||
const expected = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core2}} | ||
* {{RMassist/core}} | ||
==== Requests to revert undiscussed moves ====`; | ||
expect(Twinkle.xfd.insertRMTR(pageWikitext, wikitextToInsert)).toBe(expected); | ||
}); | ||
|
||
test('2 rows, 0 line breaks', () => { | ||
const pageWikitext = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core2}} | ||
* {{RMassist/core3}} | ||
==== Requests to revert undiscussed moves ====`; | ||
const wikitextToInsert = `* {{RMassist/core}}`; | ||
const expected = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core2}} | ||
* {{RMassist/core3}} | ||
* {{RMassist/core}} | ||
==== Requests to revert undiscussed moves ====`; | ||
expect(Twinkle.xfd.insertRMTR(pageWikitext, wikitextToInsert)).toBe(expected); | ||
}); | ||
|
||
test('1 rows, 1 line breaks', () => { | ||
const pageWikitext = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core2}} | ||
==== Requests to revert undiscussed moves ====`; | ||
const wikitextToInsert = `* {{RMassist/core}}`; | ||
const expected = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core2}} | ||
* {{RMassist/core}} | ||
==== Requests to revert undiscussed moves ====`; | ||
expect(Twinkle.xfd.insertRMTR(pageWikitext, wikitextToInsert)).toBe(expected); | ||
}); | ||
|
||
test('1 rows, 2 line breaks', () => { | ||
const pageWikitext = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core2}} | ||
==== Requests to revert undiscussed moves ====`; | ||
const wikitextToInsert = `* {{RMassist/core}}`; | ||
const expected = | ||
`<!-- Insert the following code below, filling in page names and reason: {{subst:RMassist| current page title | new title | reason = reason for move}} and enter on a new line, at the bottom of the existing list; do not add spare lines between entries; do not add a bullet point; if you do not wish the request to be converted into an RM if contested, then add |discuss=no --> | ||
* {{RMassist/core2}} | ||
* {{RMassist/core}} | ||
==== Requests to revert undiscussed moves ====`; | ||
expect(Twinkle.xfd.insertRMTR(pageWikitext, wikitextToInsert)).toBe(expected); | ||
}); | ||
}); | ||
}); |