Merge "MWInternalLinkAnnotation: test fragment behavior"

This commit is contained in:
jenkins-bot 2018-05-18 19:22:40 +00:00 committed by Gerrit Code Review
commit 9b8a859350

View file

@ -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 );