Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F1429269
DiffCompare.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
DiffCompare.js
View Options
'use strict'
;
const
{
action
,
assert
,
utils
}
=
require
(
'api-testing'
);
describe
(
'Diff Compare with Variables'
,
()
=>
{
let
wikiuser
;
const
title
=
utils
.
title
(
'DiffCompare'
);
const
variables
=
{};
before
(
async
()
=>
{
wikiuser
=
await
action
.
alice
();
}
);
it
(
'should edit a page'
,
async
()
=>
{
const
editPage
=
await
wikiuser
.
edit
(
title
,
{
text
:
'Counting: \n* One'
}
);
variables
.
revision1
=
editPage
.
newrevid
;
}
);
it
(
'should edit a page, revision 2'
,
async
()
=>
{
await
wikiuser
.
edit
(
title
,
{
text
:
'Counting: \n* One \n* Two'
}
);
}
);
it
(
'should edit a page, revision 3'
,
async
()
=>
{
const
editPage
=
await
wikiuser
.
edit
(
title
,
{
text
:
'Counting: \n* One \n* Two \n* Three'
}
);
variables
.
revision3
=
editPage
.
newrevid
;
}
);
it
(
'should edit a page, revision 4'
,
async
()
=>
{
const
editPage
=
await
wikiuser
.
edit
(
title
,
{
text
:
'Counting: \n* One \n* Two'
}
);
variables
.
revision4
=
editPage
.
newrevid
;
}
);
it
(
'should compare revisions 1 and 4'
,
async
()
=>
{
const
compareRevisions
=
await
wikiuser
.
action
(
'compare'
,
{
fromrev
:
variables
.
revision1
,
torev
:
variables
.
revision4
}
);
assert
.
match
(
compareRevisions
.
compare
[
'*'
],
/<td class=.diff-addedline.*>.*\* Two/
);
}
);
it
(
'should compare revisions 3 and 4'
,
async
()
=>
{
const
compareRevisions
=
await
wikiuser
.
action
(
'compare'
,
{
fromrev
:
variables
.
revision3
,
torev
:
variables
.
revision4
}
);
assert
.
match
(
compareRevisions
.
compare
[
'*'
],
/<td class=.diff-deletedline.*>.*\* Three/
);
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, May 16, 17:21 (9 h, 55 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
85/e7/2e1e6e9c244f5229e7d7c72b1082
Default Alt Text
DiffCompare.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment