Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4090922
ve.ui.DiffElement.test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ve.ui.DiffElement.test.js
View Options
'use strict'
;
/*!
* VisualEditor Cite-specific DiffElement tests.
*
* @copyright 2011-2018 VisualEditor Team and others; see http://ve.mit-license.org
*/
QUnit
.
module
(
've.ui.DiffElement (Cite)'
);
QUnit
.
test
(
'Diffing'
,
(
assert
)
=>
{
const
spacer
=
'<div class="ve-ui-diffElement-spacer">⋮</div>'
,
ref
=
function
(
text
,
num
)
{
const
dataMw
=
{
name
:
'ref'
,
body
:
{
html
:
text
}
// attrs doesn't get set in preview mode
};
return
'<sup typeof="mw:Extension/ref" data-mw="'
+
JSON
.
stringify
(
dataMw
).
replace
(
/"/g
,
'"'
)
+
'" class="mw-ref reference">'
+
'<a><span class="mw-reflink-text">['
+
num
+
']</span></a>'
+
'</sup>'
;
},
cases
=
[
{
msg
:
'Simple ref change'
,
oldDoc
:
ve
.
dm
.
example
.
singleLine
`
<p>
${
ref
(
'Foo'
)
}${
ref
(
'Bar'
)
}${
ref
(
'Baz'
)
}
</p>
<h2>Notes</h2>
<div typeof="mw:Extension/references" data-mw="{"name":"references"}"></div>
`
,
newDoc
:
ve
.
dm
.
example
.
singleLine
`
<p>
${
ref
(
'Foo'
)
}${
ref
(
'Bar ish'
)
}${
ref
(
'Baz'
)
}
</p>
<h2>Notes</h2>
<div typeof="mw:Extension/references" data-mw="{"name":"references"}"></div>
`
,
expected
:
ve
.
dm
.
example
.
singleLine
`
${
spacer
}
<h2 data-diff-action="none">Notes</h2>
<ol>
<li value="1"><p data-diff-action="none">Foo</p></li>
<li value="2">Bar<ins data-diff-action="insert"> ish</ins></li>
<li value="3"><p data-diff-action="none">Baz</p></li>
</ol>
`
}
];
cases
.
forEach
(
(
caseItem
)
=>
{
ve
.
test
.
utils
.
runDiffElementTest
(
assert
,
caseItem
);
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 18 2026, 11:25 (5 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
13/c6/dd992454f0ca1e55c8815aceb792
Default Alt Text
ve.ui.DiffElement.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment