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": {
|
"donations": {
|
||||||
"amount-of-total": "{amount} of {total} € collezionato",
|
"amount-of-total": "{amount} of {total} € collezionato",
|
||||||
"donate-now": "Dona ora" },
|
"donate-now": "Dona ora"
|
||||||
|
},
|
||||||
"editor": {
|
"editor": {
|
||||||
"embed": {
|
"embed": {
|
||||||
"always_allow": null,
|
"always_allow": null,
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { config, shallowMount, mount } from '@vue/test-utils'
|
import { config, shallowMount, mount } from '@vue/test-utils'
|
||||||
import PostIndex from './index.vue'
|
import PostIndex from './index.vue'
|
||||||
|
import Vue from 'vue'
|
||||||
import Vuex from 'vuex'
|
import Vuex from 'vuex'
|
||||||
import HashtagsFilter from '~/components/HashtagsFilter/HashtagsFilter'
|
import HashtagsFilter from '~/components/HashtagsFilter/HashtagsFilter'
|
||||||
|
|
||||||
@ -93,14 +94,32 @@ describe('PostIndex', () => {
|
|||||||
wrapper.find(HashtagsFilter).vm.$emit('clearSearch')
|
wrapper.find(HashtagsFilter).vm.$emit('clearSearch')
|
||||||
expect(wrapper.vm.hashtag).toBeNull()
|
expect(wrapper.vm.hashtag).toBeNull()
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
describe('mount', () => {
|
describe('mount', () => {
|
||||||
beforeEach(() => {
|
Wrapper = () => {
|
||||||
wrapper = mount(PostIndex, {
|
return mount(PostIndex, {
|
||||||
store,
|
store,
|
||||||
mocks,
|
mocks,
|
||||||
localVue,
|
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