Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Jun 17, 2021
1 parent cc13afd commit f50a883
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/server/client/alerts/update_status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 2.0.
*/

import { UpdateAlertRequest } from './client';
import { CasesClientArgs } from '..';
import { UpdateAlertRequest } from './types';

interface UpdateAlertsStatusArgs {
alerts: UpdateAlertRequest[];
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/server/client/cases/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import {
} from '../../common';
import { createCaseError } from '../../common/error';
import { ENABLE_CASE_CONNECTOR } from '../../../common/constants';
import { UpdateAlertRequest } from '../alerts/client';
import { UpdateAlertRequest } from '../alerts/types';
import { CasesClientInternal } from '../client_internal';
import { CasesClientArgs } from '..';
import { Operations, OwnerEntity } from '../../authorization';
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/cases/server/client/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const createCasesSubClientMock = (): CasesSubClientMock => {
getTags: jest.fn(),
getReporters: jest.fn(),
getCaseIDsByAlertID: jest.fn(),
getAllAlertsAttachToCase: jest.fn(),
};
};

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/server/client/sub_cases/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import {
flattenSubCaseSavedObject,
} from '../../common';
import { createCaseError } from '../../common/error';
import { UpdateAlertRequest } from '../../client/alerts/client';
import { UpdateAlertRequest } from '../../client/alerts/types';
import { CasesClientArgs } from '../types';
import { CasesClientInternal } from '../client_internal';

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/cases/server/services/alerts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ElasticsearchClient, Logger } from 'kibana/server';
import { MAX_ALERTS_PER_SUB_CASE } from '../../../common/constants';
import { AlertInfo } from '../../common';
import { createCaseError } from '../../common/error';
import { UpdateAlertRequest } from '../../client/alerts/client';
import { UpdateAlertRequest } from '../../client/alerts/types';

export type AlertServiceContract = PublicMethodsOf<AlertService>;

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/cases/server/services/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const createCaseServiceMock = (): CaseServiceMock => {
findCases: jest.fn(),
findSubCases: jest.fn(),
findSubCasesByCaseId: jest.fn(),
getAllAlertsAttachToCase: jest.fn(),
getAllCaseComments: jest.fn(),
getAllSubCaseComments: jest.fn(),
getCase: jest.fn(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ export default ({ getService }: FtrProviderContext): void => {
),
]);

const [_, case2WithComments] = await Promise.all([
createComment({
supertest: supertestWithoutAuth,
caseId: case1.id,
params: postCommentAlertReq,
auth: secOnlyAuth,
}),
const [case2WithComments] = await Promise.all([
createComment({
supertest: supertestWithoutAuth,
caseId: case2.id,
params: { ...postCommentAlertReq, alertId: 'test-id-3', owner: 'observabilityFixture' },
auth: obsOnlyAuth,
}),
createComment({
supertest: supertestWithoutAuth,
caseId: case1.id,
params: postCommentAlertReq,
auth: secOnlyAuth,
}),
]);

// This call cannot be made inside the Promise.all call
Expand Down

0 comments on commit f50a883

Please sign in to comment.