Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4004738
urlGenerator.test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
983 B
Referenced Files
None
Subscribers
None
urlGenerator.test.js
View Options
const
urlGenerator
=
require
(
'../../../resources/src/mediawiki.skinning.typeaheadSearch/urlGenerator.js'
);
describe
(
'urlGenerator'
,
()
=>
{
describe
(
'default'
,
()
=>
{
test
.
each
(
[
[
'string'
,
'title'
,
'&fulltext=1'
],
[
'object'
,
{
title
:
'title'
,
id
:
0
,
key
:
''
}
]
]
)(
'suggestion as %s'
,
(
_name
,
suggestion
,
extraParams
=
''
)
=>
{
expect
(
urlGenerator
(
'/w/index.php'
).
generateUrl
(
suggestion
)
)
.
toBe
(
`/w/index.php?title=Special%3ASearch
${
extraParams
}
&search=title`
);
}
);
test
(
'anchor'
,
()
=>
{
expect
(
urlGenerator
(
'/w/index.php'
).
generateUrl
(
{
title
:
'foo'
,
id
:
0
,
key
:
''
,
anchor
:
'bar'
}
)
).
toBe
(
'/w/index.php?title=Special%3ASearch&search=foo%23bar'
);
}
);
test
(
'custom params, articlePath'
,
()
=>
{
expect
(
urlGenerator
(
'/W/INDEX.PHP'
).
generateUrl
(
{
title
:
'title'
,
id
:
0
,
key
:
''
},
{
TITLE
:
'SPECIAL:SEARCH'
}
)
).
toBe
(
'/W/INDEX.PHP?TITLE=SPECIAL%3ASEARCH&search=title'
);
}
);
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 14 2026, 08:25 (14 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8e/e1/e4e52557df1a56c730c7e2a1b0d6
Default Alt Text
urlGenerator.test.js (983 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment