From a29d80df4ed672e2dacc6f637591ee3b29e1c3ca Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Mon, 8 Oct 2018 09:51:02 +0200 Subject: [PATCH] Update typescript notifications #13425 --- .../core/components/Picker/DescriptionOption.tsx | 8 +++----- .../core/components/Picker/PickerOption.test.tsx | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/public/app/core/components/Picker/DescriptionOption.tsx b/public/app/core/components/Picker/DescriptionOption.tsx index 6a2ae134986..2522eaa1a9d 100644 --- a/public/app/core/components/Picker/DescriptionOption.tsx +++ b/public/app/core/components/Picker/DescriptionOption.tsx @@ -2,14 +2,12 @@ import React from 'react'; import { components } from 'react-select'; import { OptionProps } from 'react-select/lib/components/Option'; -export interface Props { - children: Element; - isSelected: boolean; +// https://github.com/JedWatson/react-select/issues/3038 +interface ExtendedOptionProps extends OptionProps { data: any; - getStyles: any; } -export const Option = (props: OptionProps) => { +export const Option = (props: ExtendedOptionProps) => { const { children, isSelected, data } = props; return ( diff --git a/public/app/core/components/Picker/PickerOption.test.tsx b/public/app/core/components/Picker/PickerOption.test.tsx index 199bb74bf90..7ebcac354e8 100644 --- a/public/app/core/components/Picker/PickerOption.test.tsx +++ b/public/app/core/components/Picker/PickerOption.test.tsx @@ -7,6 +7,20 @@ const model = { clearValue: jest.fn(), onSelect: jest.fn(), getStyles: jest.fn(), + getValue: jest.fn(), + hasValue: true, + isMulti: false, + options: [], + selectOption: jest.fn(), + selectProps: {}, + setValue: jest.fn(), + isDisabled: false, + isFocused: false, + isSelected: false, + innerRef: null, + innerProps: null, + label: 'Option label', + type: null, children: 'Model title', data: { title: 'Model title',