Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7405455
ve.ce.Node.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.Node.test.js
View Options
/*!
* VisualEditor ContentEditable Node tests.
*
* @copyright See AUTHORS.txt
*/
QUnit
.
module
(
've.ce.Node'
);
/* Stubs */
ve
.
ce
.
NodeStub
=
function
VeCeNodeStub
()
{
// Parent constructor
ve
.
ce
.
NodeStub
.
super
.
apply
(
this
,
arguments
);
};
OO
.
inheritClass
(
ve
.
ce
.
NodeStub
,
ve
.
ce
.
Node
);
ve
.
ce
.
NodeStub
.
static
.
name
=
'stub'
;
ve
.
ce
.
nodeFactory
.
register
(
ve
.
ce
.
NodeStub
);
/* Tests */
QUnit
.
test
(
'getModel'
,
(
assert
)
=>
{
const
model
=
new
ve
.
dm
.
NodeStub
(),
view
=
new
ve
.
ce
.
NodeStub
(
model
);
assert
.
strictEqual
(
view
.
getModel
(),
model
,
'returns reference to model given to constructor'
);
}
);
QUnit
.
test
(
'getParent'
,
(
assert
)
=>
{
const
a
=
new
ve
.
ce
.
NodeStub
(
new
ve
.
dm
.
NodeStub
()
);
assert
.
strictEqual
(
a
.
getParent
(),
null
,
'returns null if not attached'
);
}
);
QUnit
.
test
(
'attach'
,
(
assert
)
=>
{
const
a
=
new
ve
.
ce
.
NodeStub
(
new
ve
.
dm
.
NodeStub
()
),
b
=
new
ve
.
ce
.
NodeStub
(
new
ve
.
dm
.
NodeStub
()
);
a
.
on
(
'attach'
,
(
parent
)
=>
{
assert
.
strictEqual
(
parent
,
b
,
'attach event is called with parent as first argument'
);
}
);
a
.
attach
(
b
);
assert
.
strictEqual
(
a
.
getParent
(),
b
,
'parent is set to given object after attach'
);
}
);
QUnit
.
test
(
'detach'
,
(
assert
)
=>
{
const
a
=
new
ve
.
ce
.
NodeStub
(
new
ve
.
dm
.
NodeStub
()
),
b
=
new
ve
.
ce
.
NodeStub
(
new
ve
.
dm
.
NodeStub
()
);
a
.
attach
(
b
);
a
.
on
(
'detach'
,
(
parent
)
=>
{
assert
.
strictEqual
(
parent
,
b
,
'detach event is called with parent as first argument'
);
}
);
a
.
detach
();
assert
.
strictEqual
(
a
.
getParent
(),
null
,
'parent is set null after detach'
);
}
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 19:53 (1 d, 5 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
1a/34/24f25cab231c87bc5223eb39beca
Default Alt Text
ve.ce.Node.test.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment