Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4110702
index.test.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
index.test.js
View Options
'use strict'
;
QUnit
.
module
(
'ext.checkUser.clientHints'
,
QUnit
.
newMwEnvironment
(
{}
)
);
QUnit
.
test
(
'Client hints code is setup if navigator.userAgentData.getHighEntropyValues() is available'
,
function
(
assert
)
{
const
clientHints
=
require
(
'ext.checkUser.clientHints/index.js'
);
const
responseMock
=
{
platform
:
'macOS'
};
const
navigatorData
=
{
userAgentData
:
{
getHighEntropyValues
:
this
.
sandbox
.
stub
().
returns
(
$
.
Deferred
().
resolve
(
responseMock
)
)
}
};
assert
.
true
(
clientHints
.
init
(
navigatorData
)
);
}
);
QUnit
.
test
(
'Client hints code is not setup if navigator.userAgentData is available but navigator.userAgentData.getHighEntropyValues() is not available'
,
(
assert
)
=>
{
const
clientHints
=
require
(
'ext.checkUser.clientHints/index.js'
);
const
navigatorData
=
{
userAgentData
:
{}
};
assert
.
false
(
clientHints
.
init
(
navigatorData
)
);
}
);
QUnit
.
test
(
'Client hints code is not setup if navigator.userAgentData is not defined'
,
(
assert
)
=>
{
const
clientHints
=
require
(
'ext.checkUser.clientHints/index.js'
);
const
navigatorData
=
{};
assert
.
false
(
clientHints
.
init
(
navigatorData
)
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Aug 18, 21:57 (1 d, 3 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
66/91/1a510becf8cdfa6f7fb3a6d69883
Default Alt Text
index.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment