mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-12-04 04:38:28 +00:00
911d78e8ee
Follow up to I9442b0336e22ca795cc06f76068215266fe81271 Bug: T306228 Change-Id: Ifb1f1937009b098999471cfa5e820a063dc5a4a0
30 lines
828 B
JavaScript
30 lines
828 B
JavaScript
( function () {
|
|
'use strict';
|
|
|
|
var CardModel = require( '../../resources/ext.relatedArticles.readMore/CardModel.js' ),
|
|
CardView = require( '../../resources/ext.relatedArticles.readMore/CardView.js' );
|
|
|
|
QUnit.module( 'ext.relatedArticles.cards/CardView' );
|
|
|
|
QUnit.test( '#_render escapes the thumbnailUrl model attribute', 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.strictEqual(
|
|
style,
|
|
"background-image: url(\"http://foo.bar/');display:none;\\\"//baz.jpg\");"
|
|
);
|
|
} );
|
|
}() );
|