Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7414000
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
.
true
(
factory
.
splitNodeOnEnter
(
'node-factory-node-stub'
),
'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, 01:20 (1 d, 17 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
c1/25/b44a7559c33efbee75ecf3c38124
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