mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-24 23:55:53 +00:00
2499e834bb
Follow up to 87dd101a
* bump coverage to reflect improved test state
* remove ts-ignore statements
* Drop eslint-disable-next-line compat/compat rules in ES6 code
* Drop TypeScript checking on Jest files
* Identifies an existing usage of ES7 includes method in place
where ES6 browsers need to be supported.
* Update App.vue booleans to default to false. Note this doesn't
impact our usage of the search app as we always pass these values
in.
* Drop unused eslintEs6.json configuration file
Change-Id: Ib6f1ef77bf4e27ecdcc54b5fb963818437f8195c
41 lines
909 B
JavaScript
41 lines
909 B
JavaScript
const VueTestUtils = require( '@vue/test-utils' );
|
|
const App = require( '../../resources/skins.vector.search/App.vue' );
|
|
|
|
const defaultProps = {
|
|
id: 'searchform',
|
|
searchAccessKey: 'f',
|
|
searchTitle: 'search',
|
|
showThumbnail: true,
|
|
showDescription: true,
|
|
highlightQuery: true,
|
|
searchPlaceholder: 'Search MediaWiki',
|
|
searchQuery: ''
|
|
};
|
|
|
|
const mount = ( /** @type {Object} */ customProps ) => {
|
|
return VueTestUtils.shallowMount( App, {
|
|
props: Object.assign( {}, defaultProps, customProps ),
|
|
global: {
|
|
mocks: {
|
|
$i18n: ( /** @type {string} */ str ) => ( {
|
|
text: () => str
|
|
} )
|
|
},
|
|
directives: {
|
|
'i18n-html': ( el, binding ) => {
|
|
el.innerHTML = `${binding.arg} (${binding.value})`;
|
|
}
|
|
}
|
|
}
|
|
} );
|
|
};
|
|
|
|
describe( 'App', () => {
|
|
it( 'renders a typeahead search component', () => {
|
|
const wrapper = mount();
|
|
expect(
|
|
wrapper.element
|
|
).toMatchSnapshot();
|
|
} );
|
|
} );
|