[MM-23411]: Migrate "components/suggestion/search_suggestion_list.test.jsx" to Typescript (#23671)
Этот коммит содержится в:
@@ -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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
Ссылка в новой задаче
Block a user