diff --git a/src/components/search-by-message/SearchByMessage.tsx b/src/components/search-by-message/SearchByMessage.tsx index a27f466d3..6cd029cc7 100644 --- a/src/components/search-by-message/SearchByMessage.tsx +++ b/src/components/search-by-message/SearchByMessage.tsx @@ -51,6 +51,7 @@ const SearchByMessage: FC = ({ }, [search, messages]) const onClose = () => { + setSearch('') isCloseSearch() onFilteredMessagesChange([]) } diff --git a/tests/unit/components/search-by-message/SearchByMessage.spec.jsx b/tests/unit/components/search-by-message/SearchByMessage.spec.jsx index cf35e01a9..600a11784 100644 --- a/tests/unit/components/search-by-message/SearchByMessage.spec.jsx +++ b/tests/unit/components/search-by-message/SearchByMessage.spec.jsx @@ -6,6 +6,7 @@ import SearchByMessage from '~/components/search-by-message/SearchByMessage' describe('SearchByMessage', () => { const onFilteredMessagesChange = vi.fn() const onFilteredIndexChange = vi.fn() + const isCloseSearch = vi.fn() const mockMessage = [ { _id: '64ee0a2f6ae3b95ececb05b5', @@ -38,6 +39,7 @@ describe('SearchByMessage', () => { beforeEach(() => { render(