mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Add tests for bullet indentation
Bug: T259864 Change-Id: If38016564b67ee7217fe7328b40973aa244ff467
This commit is contained in:
parent
1ce3d7ab7e
commit
b7cbd714ca
|
@ -330,9 +330,11 @@
|
|||
"cases/linearWalk/simple.html",
|
||||
"cases/en-big-oldparser/en-big-oldparser.html",
|
||||
"cases/en-big-oldparser/en-big-oldparser-modified.html",
|
||||
"cases/en-big-oldparser/en-big-oldparser-modified-bullet.html",
|
||||
"cases/en-big-oldparser/en-big-oldparser-reply.html",
|
||||
"cases/en-big-parsoid/en-big-parsoid.html",
|
||||
"cases/en-big-parsoid/en-big-parsoid-modified.html",
|
||||
"cases/en-big-parsoid/en-big-parsoid-modified-bullet.html",
|
||||
"cases/ckb-big-oldparser/ckb-big-oldparser.html",
|
||||
"cases/ckb-big-parsoid/ckb-big-parsoid.html",
|
||||
"cases/en-bigafd-parsoid/en-bigafd-parsoid.html",
|
||||
|
|
2929
tests/cases/en-big-oldparser/en-big-oldparser-modified-bullet.html
Normal file
2929
tests/cases/en-big-oldparser/en-big-oldparser-modified-bullet.html
Normal file
File diff suppressed because one or more lines are too long
3071
tests/cases/en-big-parsoid/en-big-parsoid-modified-bullet.html
Normal file
3071
tests/cases/en-big-parsoid/en-big-parsoid-modified-bullet.html
Normal file
File diff suppressed because one or more lines are too long
|
@ -31,6 +31,24 @@
|
|||
"config": "../data/enwiki-config.json",
|
||||
"data": "../data/enwiki-data.json"
|
||||
},
|
||||
{
|
||||
"name": "enwiki oldparser (bullet indentation)",
|
||||
"title": "Wikipedia:Village pump (technical)/Archive 175",
|
||||
"dom": "cases/en-big-oldparser/en-big-oldparser.html",
|
||||
"expected": "cases/en-big-oldparser/en-big-oldparser-modified-bullet.html",
|
||||
"config": "../data/enwiki-config.json",
|
||||
"data": "../data/enwiki-data.json",
|
||||
"replyIndentation": "bullet"
|
||||
},
|
||||
{
|
||||
"name": "enwiki parsoid (bullet indentation)",
|
||||
"title": "Wikipedia:Village pump (technical)/Archive 175",
|
||||
"dom": "cases/en-big-parsoid/en-big-parsoid.html",
|
||||
"expected": "cases/en-big-parsoid/en-big-parsoid-modified-bullet.html",
|
||||
"config": "../data/enwiki-config.json",
|
||||
"data": "../data/enwiki-data.json",
|
||||
"replyIndentation": "bullet"
|
||||
},
|
||||
{
|
||||
"name": "arwiki no-paragraph oldparser",
|
||||
"title": "نقاش المستخدم:Khaled",
|
||||
|
|
|
@ -19,7 +19,8 @@ class CommentModifierTest extends IntegrationTestCase {
|
|||
* @covers ::addListItem
|
||||
*/
|
||||
public function testAddListItem(
|
||||
string $name, string $title, string $dom, string $expected, string $config, string $data
|
||||
string $name, string $title, string $dom, string $expected, string $config, string $data,
|
||||
string $replyIndentation = 'invisible'
|
||||
): void {
|
||||
$title = Title::newFromText( $title );
|
||||
$origPath = $dom;
|
||||
|
@ -39,7 +40,7 @@ class CommentModifierTest extends IntegrationTestCase {
|
|||
|
||||
$nodes = [];
|
||||
foreach ( $comments as $comment ) {
|
||||
$node = CommentModifier::addListItem( $comment, 'invisible' );
|
||||
$node = CommentModifier::addListItem( $comment, $replyIndentation );
|
||||
$node->textContent = 'Reply to ' . $comment->getId();
|
||||
$nodes[] = $node;
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ require( '../cases/modified.json' ).forEach( function ( caseItem, i ) {
|
|||
// every reply would be super slow.
|
||||
var nodes = [];
|
||||
comments.forEach( function ( comment ) {
|
||||
var node = modifier.addListItem( comment, 'invisible' );
|
||||
var node = modifier.addListItem( comment, caseItem.replyIndentation || 'invisible' );
|
||||
node.textContent = 'Reply to ' + comment.id;
|
||||
nodes.push( node );
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue