mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RelatedArticles
synced 2024-12-18 19:10:54 +00:00
b528100f3d
Adds a test for resources/ext.relatedArticles.readMore/index.js Change-Id: Icf8a5afca2489308e2bcaa611c0fe27ed9f46f3a
39 lines
774 B
JavaScript
39 lines
774 B
JavaScript
const { render } = require( '../../resources/ext.relatedArticles.readMore/index.js' );
|
|
|
|
describe( 'ext.relatedArticles.readMore.bootstrap', () => {
|
|
it( 'renders without error', () => {
|
|
const element = document.createElement( 'div' );
|
|
|
|
render( [
|
|
{
|
|
title: 'Hello no description'
|
|
},
|
|
{
|
|
title: 'Hello',
|
|
description: 'Description',
|
|
thumbnail: {
|
|
source: 'hello.gif',
|
|
width: 200,
|
|
height: 200
|
|
}
|
|
},
|
|
{
|
|
title: 'Hello with extract',
|
|
extract: 'Extract',
|
|
thumbnail: {
|
|
source: 'helloEx.gif',
|
|
width: 200,
|
|
height: 200
|
|
}
|
|
},
|
|
{
|
|
title: 'Hello with pageprops',
|
|
pageprops: {
|
|
description: 'Page props desc'
|
|
}
|
|
}
|
|
], element );
|
|
expect( element.innerHTML ).toMatchSnapshot();
|
|
} );
|
|
} );
|