Skip to content

Commit

Permalink
[Security Solution] [Fix] Conflicting PRs caused check types to fai…
Browse files Browse the repository at this point in the history
…l on main,, (#155746)

## Summary

[This build
](https://buildkite.com/elastic/kibana-on-merge/builds/29366#0187b90f-c56a-428c-932e-952e86d51bc6)
was failing after the [PR - [Security solution] Mocks and Unit tests for
Alert Page controls
#155508](#155508) was merged on
main.

This happened because in between CI passed all checks and PR was merged,
there was another PR merge which had some conflicting type. It caused CI
to break on main.
  • Loading branch information
logeekal authored Apr 25, 2023
1 parent 416940c commit af3ed7b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
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

0 comments on commit af3ed7b

Please sign in to comment.