mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
fix some tests
This commit is contained in:
parent
bc955003f7
commit
5393c2aeaa
@ -58,6 +58,9 @@ describe('ContributionForm.vue', () => {
|
||||
back: jest.fn(),
|
||||
push: jest.fn(),
|
||||
},
|
||||
$env: {
|
||||
CATEGORIES_ACTIVE: false,
|
||||
},
|
||||
}
|
||||
propsData = {}
|
||||
})
|
||||
@ -132,6 +135,7 @@ describe('ContributionForm.vue', () => {
|
||||
variables: {
|
||||
title: postTitle,
|
||||
content: postContent,
|
||||
categoryIds: [],
|
||||
id: null,
|
||||
image: null,
|
||||
},
|
||||
@ -254,6 +258,7 @@ describe('ContributionForm.vue', () => {
|
||||
variables: {
|
||||
title: propsData.contribution.title,
|
||||
content: propsData.contribution.content,
|
||||
categoryIds: [],
|
||||
id: propsData.contribution.id,
|
||||
image: {
|
||||
sensitive: false,
|
||||
|
||||
@ -126,9 +126,9 @@ export default {
|
||||
imageBlurred: { required: false },
|
||||
categoryIds: {
|
||||
type: 'array',
|
||||
required: true,
|
||||
required: this.categoriesActive,
|
||||
validator: (_, value = []) => {
|
||||
if (value.length === 0 || value.length > 3) {
|
||||
if (this.categoriesActive && (value.length === 0 || value.length > 3)) {
|
||||
return [new Error(this.$t('common.validations.categories'))]
|
||||
}
|
||||
return []
|
||||
|
||||
@ -5,13 +5,13 @@ const localVue = global.localVue
|
||||
|
||||
describe('create.vue', () => {
|
||||
let wrapper
|
||||
let mocks
|
||||
|
||||
beforeEach(() => {
|
||||
mocks = {
|
||||
$t: jest.fn(),
|
||||
}
|
||||
})
|
||||
const mocks = {
|
||||
$t: jest.fn(),
|
||||
$env: {
|
||||
CATEGORIES_ACTIVE: false,
|
||||
},
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
const Wrapper = () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user