Skip to content

Commit

Permalink
update cases helper api for serverless
Browse files Browse the repository at this point in the history
  • Loading branch information
js-jankisalvi committed Aug 14, 2023
1 parent 5bae788 commit 20516f1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 167 deletions.
1 change: 1 addition & 0 deletions x-pack/test/cases_api_integration/common/lib/api/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const createCase = async (

const { body: theCase } = await apiCall
.set('kbn-xsrf', 'true')
.set('x-elastic-internal-origin', 'foo')
.set(headers)
.send(params)
.expect(expectedHttpCode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
*/

import { expect } from 'expect';
import { ConnectorTypes } from '@kbn/cases-plugin/common/types/domain';
import { FtrProviderContext } from '../../../ftr_provider_context';
import { createCase } from './helper/api';

export default ({ getPageObject, getService }: FtrProviderContext) => {
const dashboard = getPageObject('dashboard');
Expand All @@ -20,7 +18,6 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const kibanaServer = getService('kibanaServer');
const cases = getService('cases');
const find = getService('find');
const supertest = getService('supertest');

describe('persistable attachment', () => {
describe('lens visualization', () => {
Expand Down Expand Up @@ -85,23 +82,11 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {

it('adds lens visualization to an existing case from dashboard', async () => {
const theCaseTitle = 'case already exists in observability!!';
const postCaseReq = {
description: 'This is a test case to verify existing action scenario!!',
const theCase = await cases.api.createCase({
title: theCaseTitle,
tags: ['defacement'],
connector: {
id: 'none',
name: 'none',
type: ConnectorTypes.none,
fields: null,
},
settings: {
syncAlerts: true,
},
owner: 'observability',
assignees: [],
};
const theCase = await createCase(supertest, postCaseReq);
description: 'This is a test case to verify existing action scenario!!',
owner: 'observability'
});

await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'dashboards' });

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
*/

import { expect } from 'expect';
import { ConnectorTypes } from '@kbn/cases-plugin/common/types/domain';
import { FtrProviderContext } from '../../../../ftr_provider_context';
import { createCase } from './helper/api';

export default ({ getPageObject, getService }: FtrProviderContext) => {
const dashboard = getPageObject('dashboard');
Expand All @@ -19,7 +17,6 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {
const kibanaServer = getService('kibanaServer');
const cases = getService('cases');
const find = getService('find');
const supertest = getService('supertest');

describe('persistable attachment', () => {
describe('lens visualization', () => {
Expand Down Expand Up @@ -85,23 +82,11 @@ export default ({ getPageObject, getService }: FtrProviderContext) => {

it('adds lens visualization to an existing case from dashboard', async () => {
const theCaseTitle = 'case already exists in security solution!!';
const postCaseReq = {
description: 'This is a test case to verify existing action scenario!!',
const theCase = await cases.api.createCase({
title: theCaseTitle,
tags: ['defacement'],
connector: {
id: 'none',
name: 'none',
type: ConnectorTypes.none,
fields: null,
},
settings: {
syncAlerts: true,
},
description: 'This is a test case to verify existing action scenario!!',
owner: 'securitySolution',
assignees: [],
};
const theCase = await createCase(supertest, postCaseReq);
});

await testSubjects.click('solutionSideNavItemLink-dashboards');

Expand Down

This file was deleted.

0 comments on commit 20516f1

Please sign in to comment.