Merge "Add tests for bullet indentation"

This commit is contained in:
jenkins-bot 2022-01-15 02:38:31 +00:00 committed by Gerrit Code Review
commit ed8560569e
6 changed files with 6024 additions and 3 deletions

View file

@ -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",

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -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",

View file

@ -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;
}

View file

@ -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 );
} );