Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4132212
Block.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
969 B
Referenced Files
None
Subscribers
None
Block.js
View Options
'use strict'
;
const
{
action
,
assert
}
=
require
(
'api-testing'
);
describe
(
'Block'
,
()
=>
{
const
ip
=
'::'
+
Math
.
floor
(
Math
.
random
()
*
65534
).
toString
(
16
);
it
(
'should not allow multiblocks without newblock (T389028)'
,
async
()
=>
{
const
mindy
=
await
action
.
mindy
();
const
token
=
await
mindy
.
token
();
const
promises
=
[
mindy
.
request
(
{
action
:
'block'
,
user
:
ip
,
token
:
token
},
'POST'
),
mindy
.
request
(
{
action
:
'block'
,
user
:
ip
,
token
:
token
},
'POST'
)
];
const
res
=
await
Promise
.
all
(
promises
);
assert
.
lengthOf
(
res
,
2
);
assert
.
equal
(
res
[
0
].
status
,
200
);
assert
.
equal
(
res
[
1
].
status
,
200
);
const
goodIndex
=
'block'
in
res
[
0
].
body
?
0
:
1
;
const
goodBody
=
res
[
goodIndex
].
body
;
const
badBody
=
res
[
+!
goodIndex
].
body
;
assert
.
property
(
goodBody
,
'block'
);
assert
.
isOk
(
goodBody
.
block
.
id
);
assert
.
property
(
badBody
,
'error'
);
assert
.
equal
(
badBody
.
error
.
code
,
'alreadyblocked'
);
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 11:29 (3 w, 23 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
fd/c2/191ce3ec2e2336db58d91a573dda
Default Alt Text
Block.js (969 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment