Skip to content

Commit

Permalink
Update EuiSelectable onChange test mocks with new mock 3rd arg
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen committed Dec 20, 2022
1 parent 1831d74 commit 0aa8e99
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ function selectDataViewPickerOption(instance: ShallowWrapper, selectedLabel: str
? { ...option, checked: 'on' }
: { ...option, checked: undefined }
);
return getDataViewPickerList(instance).prop('onChange')!(options, event);
const selectedOption = { label: selectedLabel };
return getDataViewPickerList(instance).prop('onChange')!(options, event, selectedOption);
}

describe('DataView list component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function selectTextLanguagePickerOption(instance: ShallowWrapper, selectedLabel:
? { ...option, checked: 'on' }
: { ...option, checked: undefined }
);
return getTextLanguagesPickerList(instance).prop('onChange')!(options, event);
const selectedOption = { label: selectedLabel };
return getTextLanguagesPickerList(instance).prop('onChange')!(options, event, selectedOption);
}

describe('Text based languages list component', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ describe('field_manager', () => {
act(() => {
getInstance().find(FieldPicker).dive().find(EuiSelectable).prop('onChange')!(
[{ checked: 'on', label: 'field3' }],
event
event,
{ checked: 'on', label: 'field3' }
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ describe('Layer Data Panel', () => {
? { ...option, checked: 'on' }
: { ...option, checked: undefined }
);
return getIndexPatternPickerList(instance).prop('onChange')!(options, event);
const selectedOption = { label: selectedLabel };
return getIndexPatternPickerList(instance).prop('onChange')!(options, event, selectedOption);
}

function getIndexPatternPickerOptions(instance: ShallowWrapper) {
Expand Down

0 comments on commit 0aa8e99

Please sign in to comment.