mediawiki-extensions-Relate.../tests/jest/ext.relatedArticles.readMore.test.js
Jon Robson b528100f3d Add jest testing infrastructure
Adds a test for  resources/ext.relatedArticles.readMore/index.js

Change-Id: Icf8a5afca2489308e2bcaa611c0fe27ed9f46f3a
2022-04-19 18:51:58 +00:00

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