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(),
|
back: jest.fn(),
|
||||||
push: jest.fn(),
|
push: jest.fn(),
|
||||||
},
|
},
|
||||||
|
$env: {
|
||||||
|
CATEGORIES_ACTIVE: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
propsData = {}
|
propsData = {}
|
||||||
})
|
})
|
||||||
@ -132,6 +135,7 @@ describe('ContributionForm.vue', () => {
|
|||||||
variables: {
|
variables: {
|
||||||
title: postTitle,
|
title: postTitle,
|
||||||
content: postContent,
|
content: postContent,
|
||||||
|
categoryIds: [],
|
||||||
id: null,
|
id: null,
|
||||||
image: null,
|
image: null,
|
||||||
},
|
},
|
||||||
@ -254,6 +258,7 @@ describe('ContributionForm.vue', () => {
|
|||||||
variables: {
|
variables: {
|
||||||
title: propsData.contribution.title,
|
title: propsData.contribution.title,
|
||||||
content: propsData.contribution.content,
|
content: propsData.contribution.content,
|
||||||
|
categoryIds: [],
|
||||||
id: propsData.contribution.id,
|
id: propsData.contribution.id,
|
||||||
image: {
|
image: {
|
||||||
sensitive: false,
|
sensitive: false,
|
||||||
|
|||||||
@ -126,9 +126,9 @@ export default {
|
|||||||
imageBlurred: { required: false },
|
imageBlurred: { required: false },
|
||||||
categoryIds: {
|
categoryIds: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
required: true,
|
required: this.categoriesActive,
|
||||||
validator: (_, value = []) => {
|
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 [new Error(this.$t('common.validations.categories'))]
|
||||||
}
|
}
|
||||||
return []
|
return []
|
||||||
|
|||||||
@ -5,13 +5,13 @@ const localVue = global.localVue
|
|||||||
|
|
||||||
describe('create.vue', () => {
|
describe('create.vue', () => {
|
||||||
let wrapper
|
let wrapper
|
||||||
let mocks
|
|
||||||
|
|
||||||
beforeEach(() => {
|
const mocks = {
|
||||||
mocks = {
|
|
||||||
$t: jest.fn(),
|
$t: jest.fn(),
|
||||||
|
$env: {
|
||||||
|
CATEGORIES_ACTIVE: false,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
|
||||||
|
|
||||||
describe('mount', () => {
|
describe('mount', () => {
|
||||||
const Wrapper = () => {
|
const Wrapper = () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user