From 34ddd129483a4e94adac509edeedd262cdc9a56f Mon Sep 17 00:00:00 2001 From: aonomike Date: Mon, 9 Sep 2019 16:20:57 +0300 Subject: [PATCH] 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 --- webapp/pages/index.spec.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webapp/pages/index.spec.js b/webapp/pages/index.spec.js index 3a97e3709..5e38897c1 100644 --- a/webapp/pages/index.spec.js +++ b/webapp/pages/index.spec.js @@ -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() })