[MM-23411]: Migrate "components/suggestion/search_suggestion_list.test.jsx" to Typescript (#23671)

Этот коммит содержится в:
Muxing Lin
2023-06-20 03:43:30 -07:00
коммит произвёл GitHub
родитель ef3a772836
Коммит df43ee60e7

Просмотреть файл

@@ -5,6 +5,7 @@ import React from 'react';
import {shallow} from 'enzyme';
import SearchSuggestionList from 'components/suggestion/search_suggestion_list';
import {TestHelper} from 'utils/test_helper';
describe('components/SearchSuggestionList', () => {
const baseProps = {
@@ -21,6 +22,14 @@ describe('components/SearchSuggestionList', () => {
};
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(
<SearchSuggestionList
{...baseProps}
@@ -28,9 +37,9 @@ describe('components/SearchSuggestionList', () => {
/>,
);
const instance = wrapper.instance();
instance.currentLabel = null;
const instance = wrapper.instance() as SearchSuggestionList;
instance.currentLabel = null as any;
instance.generateLabel({});
instance.generateLabel(item);
});
});