mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-27 17:10:19 +00:00
66359e8fa5
Bug: T300561 Change-Id: Ib7c314b094bd823ae233374f63c9094724d6c06f
36 lines
799 B
JavaScript
36 lines
799 B
JavaScript
const Vue = require( 'vue' );
|
|
const VueTestUtils = require( '@vue/test-utils' );
|
|
const App = require( '../../resources/skins.vector.search/App.vue' );
|
|
|
|
// @ts-ignore
|
|
Vue.directive( 'i18n-html', () => {} );
|
|
|
|
const defaultProps = {
|
|
id: 'searchform',
|
|
searchAccessKey: 'f',
|
|
searchTitle: 'search',
|
|
searchPlaceholder: 'Search MediaWiki',
|
|
searchQuery: ''
|
|
};
|
|
|
|
const mount = ( /** @type {Object} */ customProps ) => {
|
|
// @ts-ignore
|
|
return VueTestUtils.shallowMount( App, {
|
|
propsData: Object.assign( {}, defaultProps, customProps ),
|
|
mocks: {
|
|
$i18n: ( /** @type {string} */ str ) => ( {
|
|
text: () => str
|
|
} )
|
|
}
|
|
} );
|
|
};
|
|
|
|
describe( 'App', () => {
|
|
it( 'renders a typeahead search component', () => {
|
|
const wrapper = mount();
|
|
expect(
|
|
wrapper.element
|
|
).toMatchSnapshot();
|
|
} );
|
|
} );
|