mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
MWInternalLinkAnnotation: test fragment behavior
Bug: T194463 Change-Id: I08d587c4e4cd12b1362915a22b37d9a0224de198
This commit is contained in:
parent
a47b78e18c
commit
300d5ec486
|
@ -43,6 +43,36 @@ QUnit.test( 'toDataElement', function ( assert ) {
|
|||
title: 'Foo?'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// The fragment should make it into some parts of this, and not others
|
||||
msg: 'Fragments',
|
||||
element: internalLink( 'Foo#bar' ),
|
||||
expected: {
|
||||
type: 'link/mwInternal',
|
||||
attributes: {
|
||||
hrefPrefix: '',
|
||||
lookupTitle: 'Foo',
|
||||
normalizedTitle: 'Foo#bar',
|
||||
origTitle: 'Foo#bar',
|
||||
title: 'Foo#bar'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
// Question marks in the fragment shouldn't confuse this
|
||||
msg: 'Question marks in fragments',
|
||||
element: internalLink( 'Foo#bar?' ),
|
||||
expected: {
|
||||
type: 'link/mwInternal',
|
||||
attributes: {
|
||||
hrefPrefix: '',
|
||||
lookupTitle: 'Foo',
|
||||
normalizedTitle: 'Foo#bar.3F',
|
||||
origTitle: 'Foo#bar.3F',
|
||||
title: 'Foo#bar.3F'
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
converter = new ve.dm.Converter( ve.dm.modelRegistry, ve.dm.nodeFactory, ve.dm.annotationFactory, ve.dm.metaItemFactory );
|
||||
|
|
Loading…
Reference in a new issue