mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
fix: lint and test for SearchableInput ok
This commit is contained in:
parent
1d79900e5e
commit
4a60911c9a
@ -46,6 +46,7 @@ describe('SearchResults', () => {
|
||||
|
||||
describe('contains posts', () => {
|
||||
beforeEach(() => {
|
||||
console.log
|
||||
wrapper.setData({ posts: [post], activeTab: 'Post' })
|
||||
})
|
||||
|
||||
|
||||
@ -1,14 +1,20 @@
|
||||
<template>
|
||||
<div id="search-results" class="search-results">
|
||||
<div class="search-results">
|
||||
{{ $t('search.results', { searchCount: searchCount, search: search }) }}
|
||||
<div>
|
||||
<ds-section>
|
||||
<ds-text class="search-results">
|
||||
<strong>{{ searchCount }}</strong>
|
||||
{{ $t('search.results') }}
|
||||
</ds-text>
|
||||
</ds-section>
|
||||
</div>
|
||||
|
||||
<tab-navigation :tabs="tabOptions" :activeTab="activeTab" @switchTab="switchTab" />
|
||||
<section
|
||||
:class="['results', activeTab === 'User' && '--user', !activeResourceCount > 0 && '--empty']"
|
||||
>
|
||||
<hc-empty
|
||||
v-if="!activeResourceCount"
|
||||
v-if="!activeResourceCount || searchCount === 0"
|
||||
icon="tasks"
|
||||
:message="$t('search.no-results', { search })"
|
||||
/>
|
||||
|
||||
@ -60,13 +60,6 @@ describe('SearchableInput.vue', () => {
|
||||
expect(select.element.value).toBe('abcd')
|
||||
})
|
||||
|
||||
it('searches for the term when enter is pressed', async () => {
|
||||
select.element.value = 'ab'
|
||||
select.trigger('input')
|
||||
select.trigger('keyup.enter')
|
||||
await expect(wrapper.emitted().query[0]).toEqual(['ab'])
|
||||
})
|
||||
|
||||
it('calls onDelete when the delete key is pressed', () => {
|
||||
const spy = jest.spyOn(wrapper.vm, 'onDelete')
|
||||
select.trigger('input')
|
||||
@ -117,5 +110,15 @@ describe('SearchableInput.vue', () => {
|
||||
expect(mocks.$router.push).toHaveBeenCalledWith('?hashtag=Hashtag')
|
||||
})
|
||||
})
|
||||
|
||||
it('searches for the term when enter is pressed', async () => {
|
||||
select.element.value = 'ab'
|
||||
select.trigger('input')
|
||||
select.trigger('keyup.enter')
|
||||
expect(mocks.$router.push).toHaveBeenCalledWith({
|
||||
path: '/search/search-results',
|
||||
query: { search: 'ab' },
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -595,7 +595,7 @@
|
||||
"User": "Benutzer"
|
||||
},
|
||||
"hint": "Wonach suchst Du?",
|
||||
"results": " \"{searchCount}\" Ergebnisse für \"{search}\" gefunden ",
|
||||
"results": "Ergebnisse gefunden ",
|
||||
"no-results": "Keine Ergebnisse für \"{search}\" gefunden. Versuch' es mit einem anderen Begriff!",
|
||||
"placeholder": "Suchen"
|
||||
},
|
||||
|
||||
@ -595,7 +595,7 @@
|
||||
"User": "Users"
|
||||
},
|
||||
"hint": "What are you searching for?",
|
||||
"results": " \"{searchCount}\" Results found for \"{search}\" ",
|
||||
"results": "{searchCount} Results founding",
|
||||
"no-results": "No results found for \"{search}\". Try a different search term!",
|
||||
"placeholder": "Search"
|
||||
},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user