Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7468587
urlGenerator.test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
771 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
(
'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
Mon, Nov 23, 06:40 (3 d, 14 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
68/87/a6d9c851edb2e86c4e336bc9f05e
Default Alt Text
urlGenerator.test.js (771 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment