mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-12-11 08:06:31 +00:00
6dee0147f4
* Move across all files * Rename ext-card- prefix to ext-related-articles- prefix ** Since all code using these prefixes is JS we do not have to worry about cached HTML Bug: T137021 Change-Id: I784fd132c36329fa0dcc49fe2804460061940347
32 lines
776 B
JavaScript
32 lines
776 B
JavaScript
/* jshint unused:false */
|
|
|
|
( function () {
|
|
'use strict';
|
|
|
|
var CardModel = mw.cards.CardModel,
|
|
CardView = mw.cards.CardView;
|
|
|
|
QUnit.module( 'ext.relatedArticles.cards/CardView' );
|
|
|
|
QUnit.test( '#_render escapes the thumbnailUrl model attribute', 1, function ( assert ) {
|
|
var model = new CardModel( {
|
|
title: 'One',
|
|
url: mw.util.getUrl( 'One' ),
|
|
hasThumbnail: true,
|
|
thumbnailUrl: 'http://foo.bar/\');display:none;"//baz.jpg',
|
|
isThumbnailProtrait: false
|
|
} ),
|
|
view = new CardView( model ),
|
|
style;
|
|
|
|
style = view.$el.find( '.ext-related-articles-card-thumb' )
|
|
.eq( 0 )
|
|
.attr( 'style' );
|
|
|
|
assert.equal(
|
|
style,
|
|
'background-image: url( \'http\\:\\/\\/foo\\.bar\\/\\\'\\)\\;display\\:none\\;\\"\\/\\/baz\\.jpg\' );'
|
|
);
|
|
} );
|
|
}() );
|