Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4134478
AdditionalDetailsField.test.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
922 B
Referenced Files
None
Subscribers
None
AdditionalDetailsField.test.js
View Options
const
{
shallowMount
}
=
require
(
'vue-test-utils'
);
const
{
createPinia
}
=
require
(
'pinia'
);
const
AdditionalDetailsField
=
require
(
'mediawiki.special.block.codex/components/AdditionalDetailsField.vue'
);
const
useBlockStore
=
require
(
'mediawiki.special.block.codex/stores/block.js'
);
QUnit
.
module
(
'mediawiki.special.block.AdditionalDetailsField'
,
{
beforeEach
()
{
sinon
.
stub
(
history
,
'replaceState'
);
}
}
);
QUnit
.
test
(
'should set hardBlockVisible when blocking an IP address'
,
(
assert
)
=>
{
const
wrapper
=
shallowMount
(
AdditionalDetailsField
,
{
global
:
{
plugins
:
[
createPinia
()
]
}
}
);
const
store
=
useBlockStore
();
// A username should not have the hardBlock option shown.
store
.
targetUser
=
'ExampleUser'
;
assert
.
false
(
wrapper
.
vm
.
hardBlockVisible
);
// An IP address should have hardBlock shown.
store
.
targetUser
=
'192.0.2.34'
;
assert
.
true
(
wrapper
.
vm
.
hardBlockVisible
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Aug 19, 12:40 (3 w, 2 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
14/a4/3e925815cf44cfc68285b94fcc47
Default Alt Text
AdditionalDetailsField.test.js (922 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment