Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Security Solution] [Fix] Conflicting PRs caused check types to fail on main #155746

Merged
merged 3 commits into from
Apr 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,14 @@ describe(' Filter Group Component ', () => {

it('should call controlGroupTransform which returns object WITHOUT placeholder when type != OPTION_LIST_CONTROL on opening Flyout', async () => {
const returnValueWatcher = jest.fn();
controlGroupMock.openAddDataControlFlyout.mockImplementationOnce((fn) => {
if (fn) {
const returnValue = fn({}, 'NOT_OPTIONS_LIST_CONTROL');
returnValueWatcher(returnValue);
controlGroupMock.openAddDataControlFlyout.mockImplementationOnce(
({ controlInputTransform }) => {
if (controlInputTransform) {
const returnValue = controlInputTransform({}, 'NOT_OPTIONS_LIST_CONTROL');
returnValueWatcher(returnValue);
}
}
});

);
render(<TestComponent />);
// delete some panels
const newInputData = {
Expand Down Expand Up @@ -261,12 +262,14 @@ describe(' Filter Group Component ', () => {

it('should call controlGroupTransform which returns object WITH correct placeholder value when type = OPTION_LIST_CONTROL on opening Flyout', async () => {
const returnValueWatcher = jest.fn();
controlGroupMock.openAddDataControlFlyout.mockImplementationOnce((fn) => {
if (fn) {
const returnValue = fn({}, OPTIONS_LIST_CONTROL);
returnValueWatcher(returnValue);
controlGroupMock.openAddDataControlFlyout.mockImplementationOnce(
({ controlInputTransform }) => {
if (controlInputTransform) {
const returnValue = controlInputTransform({}, OPTIONS_LIST_CONTROL);
returnValueWatcher(returnValue);
}
}
});
);

render(<TestComponent />);
// delete some panels
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@ const FilterGroupComponent = (props: PropsWithChildren<FilterGroupProps>) => {
};

const addControlsHandler = useCallback(() => {
controlGroup?.openAddDataControlFlyout(newControlInputTranform);
controlGroup?.openAddDataControlFlyout({
controlInputTransform: newControlInputTranform,
});
}, [controlGroup]);

return (
Expand Down