Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4143502
ErrorWidget.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
ErrorWidget.test.js
View Options
const
ErrorWidget
=
require
(
'ext.confirmEdit.hCaptcha/ext.confirmEdit.hCaptcha/ErrorWidget.js'
);
QUnit
.
module
(
'ext.confirmEdit.hCaptcha.ErrorWidget'
,
{
beforeEach
()
{
this
.
widget
=
new
ErrorWidget
();
$
(
'#qunit-fixture'
).
append
(
this
.
widget
.
$element
);
}
}
);
QUnit
.
test
(
'should initially be hidden and empty'
,
function
(
assert
)
{
assert
.
strictEqual
(
this
.
widget
.
$element
.
css
(
'display'
),
'none'
,
'should be hidden'
);
assert
.
strictEqual
(
this
.
widget
.
$element
.
text
(),
''
,
'message should be empty'
);
}
);
QUnit
.
test
(
'should show after initializing it with content'
,
function
(
assert
)
{
const
message
=
'some error'
;
this
.
widget
.
show
(
message
);
assert
.
notStrictEqual
(
this
.
widget
.
$element
.
css
(
'display'
),
'none'
,
'should be shown'
);
assert
.
strictEqual
(
this
.
widget
.
$element
.
text
(),
message
,
'message should match'
);
}
);
QUnit
.
test
(
'should escape HTML'
,
function
(
assert
)
{
const
message
=
'<div>some html</div>'
;
this
.
widget
.
show
(
message
);
assert
.
strictEqual
(
this
.
widget
.
$element
.
find
(
'.cdx-message__content'
).
html
(),
'<div>some html</div>'
,
'message should be escaped'
);
}
);
QUnit
.
test
(
'should be hidable via hide()'
,
function
(
assert
)
{
const
message
=
'some error'
;
this
.
widget
.
show
(
message
);
this
.
widget
.
hide
();
assert
.
strictEqual
(
this
.
widget
.
$element
.
css
(
'display'
),
'none'
,
'should be hidden'
);
assert
.
strictEqual
(
this
.
widget
.
$element
.
text
(),
message
,
'message should match'
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 19 2026, 16:51 (4 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
56/f2/73a65763bf7a52c323d940ff3ba8
Default Alt Text
ErrorWidget.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment