Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4145516
AdditionalDetailsField.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
AdditionalDetailsField.test.js
View Options
'use strict'
;
const
{
shallowMount
}
=
require
(
'@vue/test-utils'
);
const
{
createTestingPinia
}
=
require
(
'@pinia/testing'
);
const
{
mockMwConfigGet
}
=
require
(
'./SpecialBlock.setup.js'
);
const
AdditionalDetailsField
=
require
(
'../../../resources/src/mediawiki.special.block/components/AdditionalDetailsField.vue'
);
const
useBlockStore
=
require
(
'../../../resources/src/mediawiki.special.block/stores/block.js'
);
describe
(
'AdditionalDetailsField'
,
()
=>
{
it
(
'should set hardBlockVisible when blocking an IP address'
,
()
=>
{
mockMwConfigGet
();
const
wrapper
=
shallowMount
(
AdditionalDetailsField
,
{
global
:
{
plugins
:
[
createTestingPinia
(
{
stubActions
:
false
}
)
]
}
}
);
const
store
=
useBlockStore
();
// A username should not have the hardBlock option shown.
store
.
targetUser
=
'ExampleUser'
;
mw
.
util
.
isIPAddress
.
mockReturnValue
(
false
);
expect
(
wrapper
.
vm
.
hardBlockVisible
).
toStrictEqual
(
false
);
// An IP address should have hardBlock shown.
store
.
targetUser
=
'192.0.2.34'
;
mw
.
util
.
isIPAddress
.
mockReturnValue
(
true
);
expect
(
wrapper
.
vm
.
hardBlockVisible
).
toStrictEqual
(
true
);
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 19 2026, 17:40 (5 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
8e/65/3c214ecd14d6f4e01f34735f0952
Default Alt Text
AdditionalDetailsField.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment