Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7413067
ve.ce.NodeFactory.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
ve.ce.NodeFactory.test.js
View Options
/*!
* VisualEditor ContentEditable NodeFactory tests.
*
* @copyright See AUTHORS.txt
*/
QUnit
.
module
(
've.ce.NodeFactory'
);
/* Stubs */
ve
.
ce
.
NodeFactoryNodeStub
=
function
VeCeNodeFactoryNodeStub
()
{};
OO
.
inheritClass
(
ve
.
ce
.
NodeFactoryNodeStub
,
ve
.
ce
.
LeafNode
);
ve
.
ce
.
NodeFactoryNodeStub
.
static
.
splitOnEnter
=
true
;
ve
.
ce
.
NodeFactoryNodeStub
.
static
.
name
=
'node-factory-node-stub'
;
ve
.
ce
.
NodeFactoryNodeStub
.
static
.
getDescription
=
function
()
{
return
'description'
;
};
/* Tests */
QUnit
.
test
(
'splitNodeOnEnter/getDescription'
,
(
assert
)
=>
{
const
factory
=
new
ve
.
ce
.
NodeFactory
();
assert
.
throws
(
()
=>
{
factory
.
splitNodeOnEnter
(
'node-factory-node-stub'
);
},
Error
,
'throws an exception when calling splitNodeOnEnter on an unregistered type'
);
assert
.
throws
(
()
=>
{
factory
.
getDescription
(
new
ve
.
dm
.
NodeFactoryNodeStub
()
);
},
Error
,
'throws an exception when calling getDescription on an unregistered type'
);
factory
.
register
(
ve
.
ce
.
NodeFactoryNodeStub
);
assert
.
strictEqual
(
factory
.
splitNodeOnEnter
(
'node-factory-node-stub'
),
true
,
'splitNodeOnEnter'
);
assert
.
strictEqual
(
factory
.
getDescription
(
new
ve
.
dm
.
NodeFactoryNodeStub
()
),
'description'
,
'getDescription'
);
}
);
QUnit
.
test
(
'initialization'
,
(
assert
)
=>
{
assert
.
true
(
ve
.
ce
.
nodeFactory
instanceof
ve
.
ce
.
NodeFactory
,
'factory is initialized at ve.ce.nodeFactory'
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 00:47 (1 d, 18 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
81/50/62c268d4205b7ec1210b2b9317c1
Default Alt Text
ve.ce.NodeFactory.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment