Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4201841
PrefixSearch.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
847 B
Referenced Files
None
Subscribers
None
PrefixSearch.js
View Options
'use strict'
;
const
{
action
,
assert
,
utils
}
=
require
(
'api-testing'
);
describe
(
'Prefix Search'
,
()
=>
{
const
prefix
=
`R
${
utils
.
title
(
utils
.
uniq
()
)
}
`
;
const
firstPage
=
`
${
prefix
}
_first`
;
const
secondPage
=
`
${
prefix
}
_second`
;
const
thirdPage
=
`
${
prefix
}
_third`
;
let
alice
;
before
(
async
()
=>
{
alice
=
await
action
.
alice
();
const
text
=
'Random Text'
;
await
alice
.
edit
(
firstPage
,
{
text
}
);
await
alice
.
edit
(
secondPage
,
{
text
}
);
await
alice
.
edit
(
thirdPage
,
{
text
}
);
}
);
it
(
'should search for pages with the `${prefix}` prefix'
,
async
()
=>
{
const
result
=
await
alice
.
list
(
'prefixsearch'
,
{
pssearch
:
`
${
prefix
}
`
,
pslimit
:
100
}
);
const
pageTitles
=
result
.
map
(
(
p
)
=>
utils
.
dbkey
(
p
.
title
)
);
assert
.
sameMembers
(
pageTitles
,
[
firstPage
,
secondPage
,
thirdPage
]
);
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 21 2026, 00:24 (11 w, 6 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b2/a7/02064801876c5e5d39455a37bf09
Default Alt Text
PrefixSearch.js (847 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment