mediawiki-extensions-Relate.../tests/qunit/ext.relatedArticles.cards/CardView.js
Fomafix 969ae7c05f Remove unused jshint comment
Change-Id: If1db410a48a754a4f892b6164f6a4997bed3bec4
2018-08-17 14:06:24 +02:00

30 lines
746 B
JavaScript

( 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', 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\' );'
);
} );
}() );