mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
Merge "Add more test cases for isSingleCommentSignedBy()"
This commit is contained in:
commit
3c4c018a2b
|
@ -63,21 +63,21 @@
|
||||||
"expected": true
|
"expected": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"msg": "Signed with 5 tildes",
|
"msg": "Incorrectly signed (with 5 tildes)",
|
||||||
"title": "Talk:A",
|
"title": "Talk:A",
|
||||||
"user": "X",
|
"user": "X",
|
||||||
"html": "<p>Foo bar 00:01, 1 January 2020 (UTC)\n</p>",
|
"html": "<p>Foo bar 00:01, 1 January 2020 (UTC)\n</p>",
|
||||||
"expected": false
|
"expected": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"msg": "Signed with 3 tildes",
|
"msg": "Incorrectly signed (with 3 tildes)",
|
||||||
"title": "Talk:A",
|
"title": "Talk:A",
|
||||||
"user": "X",
|
"user": "X",
|
||||||
"html": "<p>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>)\n</p>",
|
"html": "<p>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>)\n</p>",
|
||||||
"expected": false
|
"expected": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"msg": "Already signed by the wrong user",
|
"msg": "Incorrectly signed (by the wrong user)",
|
||||||
"title": "Talk:A",
|
"title": "Talk:A",
|
||||||
"user": "Y",
|
"user": "Y",
|
||||||
"html": "<p>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)\n</p>",
|
"html": "<p>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)\n</p>",
|
||||||
|
@ -97,6 +97,13 @@
|
||||||
"html": "<p>(Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC))\n</p>",
|
"html": "<p>(Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC))\n</p>",
|
||||||
"expected": true
|
"expected": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"msg": "Already signed (not at the end, with more text following on the same line)",
|
||||||
|
"title": "Talk:A",
|
||||||
|
"user": "X",
|
||||||
|
"html": "<p>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC) Ceterum censeo Carthaginem esse delendam.\n</p>",
|
||||||
|
"expected": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"msg": "Already signed (not at the end, <small>)",
|
"msg": "Already signed (not at the end, <small>)",
|
||||||
"title": "Talk:A",
|
"title": "Talk:A",
|
||||||
|
@ -118,6 +125,20 @@
|
||||||
"html": "<table>\n<tbody><tr>\n<td>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)\n</td></tr></tbody></table>",
|
"html": "<table>\n<tbody><tr>\n<td>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)\n</td></tr></tbody></table>",
|
||||||
"expected": true
|
"expected": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"msg": "Already signed (wrapper with trailers)",
|
||||||
|
"title": "Talk:A",
|
||||||
|
"user": "X",
|
||||||
|
"html": "<table>\n<tbody><tr>\n<td>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)\n</td></tr></tbody></table> <!-- Template:Foo -->\n<link rel=\"mw:PageProp/Category\" href=\"./Category:Foo\"/>",
|
||||||
|
"expected": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"msg": "Incorrectly signed (wrapper, with more text following on another line)",
|
||||||
|
"title": "Talk:A",
|
||||||
|
"user": "X",
|
||||||
|
"html": "<table>\n<tbody><tr>\n<td>Foo bar <a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)\n</td></tr></tbody></table>\nCeterum censeo Carthaginem esse delendam.",
|
||||||
|
"expected": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"msg": "Already signed (multi-line)",
|
"msg": "Already signed (multi-line)",
|
||||||
"title": "Talk:A",
|
"title": "Talk:A",
|
||||||
|
@ -133,14 +154,14 @@
|
||||||
"expected": true
|
"expected": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"msg": "Already signed (not at the end, multiline)",
|
"msg": "Incorrectly signed (multiline, with more text following on another line)",
|
||||||
"title": "Talk:A",
|
"title": "Talk:A",
|
||||||
"user": "X",
|
"user": "X",
|
||||||
"html": "<p>Foo\n</p><p><a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)\n</p><p>bar\n</p>",
|
"html": "<p>Foo\n</p><p><a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)\n</p><p>bar\n</p>",
|
||||||
"expected": false
|
"expected": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"msg": "Already signed (not at the end, multiline) [indented]",
|
"msg": "Incorrectly signed (multiline, with more text following on another line) [indented]",
|
||||||
"title": "Talk:A",
|
"title": "Talk:A",
|
||||||
"user": "X",
|
"user": "X",
|
||||||
"html": "<dl><dd>Foo</dd>\n<dd><a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)</dd>\n<dd>bar</span></dd></dl>",
|
"html": "<dl><dd>Foo</dd>\n<dd><a href=\"/wiki/User:X\" title=\"User:X\">X</a> (<a href=\"/wiki/User_talk:X\" title=\"User talk:X\">talk</a>) 00:01, 1 January 2020 (UTC)</dd>\n<dd>bar</span></dd></dl>",
|
||||||
|
|
Loading…
Reference in a new issue