Page MenuHomeWickedGov Phorge

ve.dm.Annotation.test.js
No OneTemporary

Size
865 B
Referenced Files
None
Subscribers
None

ve.dm.Annotation.test.js

/*!
* VisualEditor DataModel Annotation tests.
*
* @copyright See AUTHORS.txt
*/
QUnit.module( 've.dm.Annotation' );
QUnit.test( 'getHashObject', ( assert ) => {
const cases = [
{
msg: 'Bold',
annotation: new ve.dm.BoldAnnotation( {
type: 'textStyle/bold',
attributes: { nodeName: 'b' }
} ),
expected: {
type: 'textStyle/bold',
attributes: { nodeName: 'b' }
}
},
{
msg: 'Italic with original DOM elements',
annotation: new ve.dm.ItalicAnnotation( {
type: 'textStyle/italic',
attributes: { nodeName: 'i' },
originalDomElementsHash: 1
} ),
expected: {
type: 'textStyle/italic',
attributes: { nodeName: 'i' },
originalDomElementsHash: 1
}
}
];
cases.forEach( ( caseItem ) => {
assert.deepEqual( caseItem.annotation.getHashObject(), caseItem.expected, caseItem.msg );
} );
} );

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 22, 04:11 (1 d, 7 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7a/37/21be74a8149b458f22452f9f974d
Default Alt Text
ve.dm.Annotation.test.js (865 B)

Event Timeline