mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
[MM-23411]: Migrate "components/suggestion/search_suggestion_list.test.jsx" to Typescript (#23671)
This commit is contained in:
parent
ef3a772836
commit
df43ee60e7
@ -5,6 +5,7 @@ import React from 'react';
|
|||||||
import {shallow} from 'enzyme';
|
import {shallow} from 'enzyme';
|
||||||
|
|
||||||
import SearchSuggestionList from 'components/suggestion/search_suggestion_list';
|
import SearchSuggestionList from 'components/suggestion/search_suggestion_list';
|
||||||
|
import {TestHelper} from 'utils/test_helper';
|
||||||
|
|
||||||
describe('components/SearchSuggestionList', () => {
|
describe('components/SearchSuggestionList', () => {
|
||||||
const baseProps = {
|
const baseProps = {
|
||||||
@ -21,6 +22,14 @@ describe('components/SearchSuggestionList', () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
test('should not throw error when currentLabel is null and label is generated', () => {
|
test('should not throw error when currentLabel is null and label is generated', () => {
|
||||||
|
const userProfile = TestHelper.getUserMock();
|
||||||
|
const item = {
|
||||||
|
...userProfile,
|
||||||
|
type: 'item_type',
|
||||||
|
display_name: 'item_display_name',
|
||||||
|
name: 'item_name',
|
||||||
|
};
|
||||||
|
|
||||||
const wrapper = shallow(
|
const wrapper = shallow(
|
||||||
<SearchSuggestionList
|
<SearchSuggestionList
|
||||||
{...baseProps}
|
{...baseProps}
|
||||||
@ -28,9 +37,9 @@ describe('components/SearchSuggestionList', () => {
|
|||||||
/>,
|
/>,
|
||||||
);
|
);
|
||||||
|
|
||||||
const instance = wrapper.instance();
|
const instance = wrapper.instance() as SearchSuggestionList;
|
||||||
instance.currentLabel = null;
|
instance.currentLabel = null as any;
|
||||||
|
|
||||||
instance.generateLabel({});
|
instance.generateLabel(item);
|
||||||
});
|
});
|
||||||
});
|
});
|
Loading…
Reference in New Issue
Block a user