fix tests for contribution form

This commit is contained in:
Moriz Wahl 2023-05-23 11:04:01 +02:00
parent 59e7f8c0d2
commit e3eaaf4435
3 changed files with 7 additions and 2 deletions

View File

@ -15,6 +15,7 @@ const stubs = {
'client-only': true, 'client-only': true,
'nuxt-link': true, 'nuxt-link': true,
'v-popover': true, 'v-popover': true,
'date-picker': true,
} }
describe('ContributionForm.vue', () => { describe('ContributionForm.vue', () => {
@ -45,6 +46,7 @@ describe('ContributionForm.vue', () => {
slug: 'this-is-a-title-for-a-post', slug: 'this-is-a-title-for-a-post',
content: postContent, content: postContent,
contentExcerpt: postContent, contentExcerpt: postContent,
postType: ['Article'],
}, },
}, },
}), }),
@ -142,6 +144,7 @@ describe('ContributionForm.vue', () => {
id: null, id: null,
image: null, image: null,
groupId: null, groupId: null,
postType: 'Article',
}, },
} }
postTitleInput = wrapper.find('.ds-input') postTitleInput = wrapper.find('.ds-input')
@ -268,6 +271,7 @@ describe('ContributionForm.vue', () => {
image: { image: {
sensitive: false, sensitive: false,
}, },
postType: 'Article',
}, },
} }
}) })

View File

@ -28,7 +28,7 @@ describe('PostTeaser', () => {
author: { author: {
id: 'u1', id: 'u1',
}, },
postType: 'Article', postType: ['Article'],
}, },
} }
stubs = { stubs = {

View File

@ -29,8 +29,9 @@ module.exports = {
modulePathIgnorePatterns: ['<rootDir>/dist/'], modulePathIgnorePatterns: ['<rootDir>/dist/'],
moduleNameMapper: { moduleNameMapper: {
'\\.(svg)$': '<rootDir>/test/fileMock.js', '\\.(svg)$': '<rootDir>/test/fileMock.js',
'\\.(css|less)$': 'identity-obj-proxy', '\\.(scss|css|less)$': 'identity-obj-proxy',
'@mapbox/mapbox-gl-geocoder': 'identity-obj-proxy', '@mapbox/mapbox-gl-geocoder': 'identity-obj-proxy',
'vue2-datepicker/locale/undefined': 'vue2-datepicker/locale/en',
'^@/(.*)$': '<rootDir>/src/$1', '^@/(.*)$': '<rootDir>/src/$1',
'^~/(.*)$': '<rootDir>/$1', '^~/(.*)$': '<rootDir>/$1',
}, },