mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-27 17:00:37 +00:00
Fix test case with type with space in it
Types should not have spaces in them. In the current example this results in a page preview element with an additional class "<"\'>" I'm not sure what this is protecting against since we can trust types to always be in a sensible class friendly form. It would be better to throw an error in the mw.popups.register function than allow this. Change-Id: If08c5162c1ca0fc3db4944092231061e22113263
This commit is contained in:
parent
76973662d1
commit
3bd4275023
|
@ -254,7 +254,7 @@ QUnit.test( 'createEmptyPreview(null model)', ( assert ) => {
|
|||
QUnit.test( 'createPreviewWithType(model with unknown type)', ( assert ) => {
|
||||
const model = {
|
||||
url: '/wiki/Unknown <"\'>',
|
||||
type: 'unknown <"\'>'
|
||||
type: 'unknown'
|
||||
},
|
||||
emptyPreview = renderer.createPreviewWithType( model );
|
||||
|
||||
|
@ -265,12 +265,12 @@ QUnit.test( 'createPreviewWithType(model with unknown type)', ( assert ) => {
|
|||
);
|
||||
assert.strictEqual(
|
||||
emptyPreview.el.attr( 'class' ),
|
||||
'mwe-popups mwe-popups-type-unknown <"\'>',
|
||||
'mwe-popups mwe-popups-type-unknown',
|
||||
'Popup type is safely espaced'
|
||||
);
|
||||
assert.strictEqual(
|
||||
emptyPreview.el.find( '.mw-ui-icon' ).attr( 'class' ),
|
||||
'mw-ui-icon mw-ui-icon-element mw-ui-icon-preview-unknown <"\'>',
|
||||
'mw-ui-icon mw-ui-icon-element mw-ui-icon-preview-unknown',
|
||||
'Icon type is safely espaced'
|
||||
);
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue