Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4137734
mwpopups.test.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
mwpopups.test.js
View Options
import
createMwPopups
from
'../../../src/integrations/mwpopups'
;
/**
* @private
* @param {*} state
* @return {Object}
*/
function
mockStore
(
state
)
{
return
{
getState
()
{
return
state
;
}
};
}
QUnit
.
module
(
'ext.popups/integrations'
);
QUnit
.
test
(
'#isEnabled returns correct value when disabled'
,
function
(
assert
)
{
const
state
=
{
preview
:
{
enabled
:
{
page
:
false
}
}
},
store
=
mockStore
(
state
),
popups
=
createMwPopups
(
store
);
this
.
sandbox
.
spy
(
store
,
'getState'
);
assert
.
strictEqual
(
popups
.
isEnabled
(),
false
,
'Popups are disabled.'
);
assert
.
strictEqual
(
store
.
getState
.
callCount
,
1
,
'The store was checked.'
);
}
);
QUnit
.
test
(
'#isEnabled returns correct value when enabled'
,
function
(
assert
)
{
const
state
=
{
preview
:
{
enabled
:
{
page
:
true
}
}
},
store
=
mockStore
(
state
),
popups
=
createMwPopups
(
store
);
this
.
sandbox
.
spy
(
store
,
'getState'
);
assert
.
strictEqual
(
popups
.
isEnabled
(),
true
,
'Popups are enabled.'
);
assert
.
strictEqual
(
store
.
getState
.
callCount
,
1
,
'The store was checked.'
);
}
);
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Wed, Aug 19, 14:16 (3 w, 4 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8e/af/dc9a023e6c9a0794aac1780adf7a
Default Alt Text
mwpopups.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment