Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2754054
jscompat.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
jscompat.test.js
View Options
// JavaScript compatibility tests to confirm that server and browser
// are behaving consistently and configured correctly.
QUnit
.
module
(
'startup/jscompat'
,
()
=>
{
QUnit
.
test
(
'Unicode variable name'
,
(
assert
)
=>
{
const
ŝablono
=
true
;
assert
.
true
(
ŝablono
,
'ŝablono'
);
assert
.
true
(
\u015dablono
,
'\\u015dablono'
);
assert
.
true
(
\u015Dablono
,
'\\u015Dablono'
);
}
);
function
repeat
(
str
,
n
)
{
let
out
;
if
(
n
<=
0
)
{
return
''
;
}
else
{
out
=
[];
out
.
length
=
n
+
1
;
return
out
.
join
(
str
);
}
}
QUnit
.
test
.
each
(
'textarea strips newline (T14130)'
,
[
0
,
1
,
2
,
3
],
(
assert
,
i
)
=>
{
const
expected
=
repeat
(
'\n'
,
i
)
+
'some text'
;
let
$textarea
;
// When setting HTML, we expect exactly 1 newline to be stripped.
$textarea
=
$
(
'<textarea>\n'
+
expected
+
'</textarea>'
);
assert
.
strictEqual
(
$textarea
.
val
(),
expected
,
'read after setting HTML'
);
$textarea
=
$
(
'<textarea>'
).
val
(
expected
);
assert
.
strictEqual
(
$textarea
.
val
(),
expected
,
'read after setting value'
);
}
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jul 3, 22:06 (2 h, 22 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
5f/38/8e5235438e1a2a83b7806ce8f7e7
Default Alt Text
jscompat.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment