Fix test by setting value of the mocked hashtag

- The test wasnt testing anything as the hashtag value was defaulting to null
- Fixed by setting value of hashtag to a string and then testing if the clearSearch works
This commit is contained in:
aonomike 2019-09-09 16:20:57 +03:00
parent 3d419c1f21
commit 34ddd12948

View File

@ -88,6 +88,8 @@ describe('PostIndex', () => {
})
it('clears the search when the filter menu emits clearSearch', () => {
mocks.$route.query.hashtag = '#samplehashtag'
wrapper = Wrapper()
wrapper.find(FilterMenu).vm.$emit('clearSearch')
expect(wrapper.vm.hashtag).toBeNull()
})