From 002c9f57860940649b02deef2b802ec2bae8287d Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Mon, 26 Apr 2021 00:36:32 +0200 Subject: [PATCH] head test search-results.spec.js --- webapp/pages/search/search-results.spec.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/webapp/pages/search/search-results.spec.js b/webapp/pages/search/search-results.spec.js index d1fbb33e2..8a7767374 100644 --- a/webapp/pages/search/search-results.spec.js +++ b/webapp/pages/search/search-results.spec.js @@ -1,7 +1,10 @@ import { config, mount } from '@vue/test-utils' import searchResults from './search-results.vue' +import VueMeta from 'vue-meta' const localVue = global.localVue +localVue.use(VueMeta, { keyName: 'head' }) + config.stubs['client-only'] = '' describe('search-results.vue', () => { @@ -10,7 +13,7 @@ describe('search-results.vue', () => { beforeEach(() => { mocks = { - $t: jest.fn(), + $t: (t) => t, } }) @@ -26,5 +29,9 @@ describe('search-results.vue', () => { it('renders', () => { expect(wrapper.findAll('.search-results')).toHaveLength(1) }) + + it('has correct content', () => { + expect(wrapper.vm.$metaInfo.title).toBe('search.title') + }) }) })