add test GroupContentMenu ans GroupForm

This commit is contained in:
ogerly 2022-09-27 11:24:02 +02:00
parent 211a4b9130
commit e430f22392
2 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,36 @@
import { mount } from '@vue/test-utils'
import GroupContentMenu from './GroupContentMenu.vue'
const localVue = global.localVue
const propsData = {
resource: {},
group: {},
resourceType: 'group',
}
describe('GroupContentMenu', () => {
let wrapper
let mocks
beforeEach(() => {
mocks = {
$t: jest.fn(),
}
})
describe('mount', () => {
const Wrapper = () => {
return mount(GroupContentMenu, { propsData, mocks, localVue })
}
beforeEach(() => {
wrapper = Wrapper()
})
it('renders', () => {
expect(wrapper.findAll('.group-menu')).toHaveLength(1)
})
})
})

View File

@ -0,0 +1,39 @@
import { config, mount } from '@vue/test-utils'
import GroupForm from './GroupForm.vue'
const localVue = global.localVue
config.stubs['nuxt-link'] = '<span><slot /></span>'
const propsData = {
update: false,
group: {},
}
describe('GroupForm', () => {
let wrapper
let mocks
beforeEach(() => {
mocks = {
$t: jest.fn(),
$env: {
CATEGORIES_ACTIVE: true,
},
}
})
describe('mount', () => {
const Wrapper = () => {
return mount(GroupForm, { propsData, mocks, localVue })
}
beforeEach(() => {
wrapper = Wrapper()
})
it('renders', () => {
expect(wrapper.findAll('.group-form')).toHaveLength(1)
})
})
})