specs for Search for Hashtags

This commit is contained in:
Moriz Wahl 2020-03-19 15:09:43 +01:00
parent e7d0e1b61e
commit 7024ea0b30
2 changed files with 14 additions and 0 deletions

View File

@ -106,6 +106,16 @@ describe('SearchableInput.vue', () => {
params: { id: 'u2', slug: 'bob-der-baumeister' },
})
})
it('pushes hashtag query params', async () => {
select.element.value = 'Hash'
select.trigger('input')
const tags = wrapper.findAll('.hc-hashtag')
const tag = tags.filter(item => item.text().match(/#Hashtag/))
tag.trigger('click')
await Vue.nextTick()
expect(mocks.$router.push).toHaveBeenCalledWith('?hashtag=Hashtag')
})
})
})
})

View File

@ -106,6 +106,10 @@ export const searchResults = [
name: 'Tonya Mohr',
slug: 'tonya-mohr',
},
{
id: 'Hashtag',
__typename: 'Tag',
},
]
storiesOf('Search Field', module)