Skip to content

Commit

Permalink
fix executor test
Browse files Browse the repository at this point in the history
  • Loading branch information
ersin-erdal committed Aug 26, 2024
1 parent 5cc8053 commit 23b4921
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/actions/server/lib/action_executor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/

import { KibanaRequest } from '@kbn/core/server';
import { schema } from '@kbn/config-schema';
import { ActionExecutor } from './action_executor';
Expand Down Expand Up @@ -229,9 +228,12 @@ const getBaseExecuteEventLogDoc = (
};
};

const mockGetRequestBodyByte = jest.spyOn(ConnectorUsageCollector.prototype, 'getRequestBodyByte');

beforeEach(() => {
jest.resetAllMocks();
jest.clearAllMocks();
mockGetRequestBodyByte.mockReturnValue(0);
spacesMock.getSpaceId.mockReturnValue('some-namespace');
loggerMock.get.mockImplementation(() => loggerMock);
const mockRealm = { name: 'default_native', type: 'native' };
Expand All @@ -250,8 +252,6 @@ beforeEach(() => {
getActionsAuthorizationWithRequest.mockReturnValue(authorizationMock);
});

const mockGetRequestBodyByte = jest.spyOn(ConnectorUsageCollector.prototype, 'getRequestBodyByte');

describe('Action Executor', () => {
for (const executeUnsecure of [false, true]) {
const label = executeUnsecure ? 'executes unsecured' : 'executes';
Expand Down

0 comments on commit 23b4921

Please sign in to comment.