mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Write tests
This commit is contained in:
parent
da951c6fb6
commit
124d752e38
@ -253,7 +253,8 @@
|
||||
},
|
||||
"donations": {
|
||||
"amount-of-total": "{amount} of {total} € collezionato",
|
||||
"donate-now": "Dona ora" },
|
||||
"donate-now": "Dona ora"
|
||||
},
|
||||
"editor": {
|
||||
"embed": {
|
||||
"always_allow": null,
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import { config, shallowMount, mount } from '@vue/test-utils'
|
||||
import PostIndex from './index.vue'
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
import HashtagsFilter from '~/components/HashtagsFilter/HashtagsFilter'
|
||||
|
||||
@ -93,14 +94,32 @@ describe('PostIndex', () => {
|
||||
wrapper.find(HashtagsFilter).vm.$emit('clearSearch')
|
||||
expect(wrapper.vm.hashtag).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = mount(PostIndex, {
|
||||
store,
|
||||
mocks,
|
||||
localVue,
|
||||
})
|
||||
describe('mount', () => {
|
||||
Wrapper = () => {
|
||||
return mount(PostIndex, {
|
||||
store,
|
||||
mocks,
|
||||
localVue,
|
||||
})
|
||||
}
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
describe('donation-info', () => {
|
||||
it('shows donation-info on default', () => {
|
||||
wrapper = Wrapper()
|
||||
expect(wrapper.find('.top-info-bar').exists()).toBe(true)
|
||||
})
|
||||
|
||||
it('hides donation-info if not "showDonations"', () => {
|
||||
wrapper = Wrapper()
|
||||
wrapper.setData({ showDonations: false })
|
||||
Vue.nextTick()
|
||||
expect(wrapper.find('.top-info-bar').exists()).toBe(false)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user