Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic authored and MadameSheema committed Nov 28, 2020
1 parent 1b8a4db commit 8668c64
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { loginAndWaitForPageWithoutDateRange } from '../tasks/login';
import { case1, ids, mockConnectorsResponse, responses } from '../objects/case';
import { case1, connectorIds, mockConnectorsResponse, executeResponses } from '../objects/case';
import { createNewCaseWithConnector } from '../tasks/create_new_case';
import { CONNECTOR_TITLE } from '../screens/edit_connector';
import { goToCreateNewCase } from '../tasks/all_cases';
Expand All @@ -15,19 +15,19 @@ describe('Cases connector incident fields', () => {
before(() => {
cy.server();
cy.route('GET', '**/api/cases/configure/connectors/_find', mockConnectorsResponse);
cy.route2('POST', `**/api/actions/action/${ids.jira}/_execute`, (req) => {
cy.route2('POST', `**/api/actions/action/${connectorIds.jira}/_execute`, (req) => {
const response =
JSON.parse(req.body).params.subAction === 'issueTypes'
? JSON.stringify(responses.jira.issueTypes)
: JSON.stringify(responses.jira.fieldsByIssueType);
req.reply(response);
? executeResponses.jira.issueTypes
: executeResponses.jira.fieldsByIssueType;
req.reply(JSON.stringify(response));
});
cy.route2('POST', `**/api/actions/action/${ids.resilient}/_execute`, (req) => {
cy.route2('POST', `**/api/actions/action/${connectorIds.resilient}/_execute`, (req) => {
const response =
JSON.parse(req.body).params.subAction === 'incidentTypes'
? JSON.stringify(responses.resilient.incidentTypes)
: JSON.stringify(responses.resilient.severity);
req.reply(response);
? executeResponses.resilient.incidentTypes
: executeResponses.resilient.severity;
req.reply(JSON.stringify(response));
});
});
it('Correct incident fields show when connector is changed', () => {
Expand Down
18 changes: 9 additions & 9 deletions x-pack/plugins/security_solution/cypress/objects/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ export const serviceNowConnector: Connector = {
};

export const TIMELINE_CASE_ID = '68248e00-f689-11ea-9ab2-59238b522856';
export const ids = {
export const connectorIds = {
jira: '000e5f86-08b0-4882-adfd-6df981d45c1b',
sn: '93a69ba3-3c31-4b4c-bf86-cc79a090f437',
resilient: 'a6a8dd7f-7e88-48fe-9b9f-70b668da8cbc',
};

export const mockConnectorsResponse = [
{
id: ids.jira,
id: connectorIds.jira,
actionTypeId: '.jira',
name: 'Jira',
config: {
Expand All @@ -71,7 +71,7 @@ export const mockConnectorsResponse = [
referencedByCount: 0,
},
{
id: ids.resilient,
id: connectorIds.resilient,
actionTypeId: '.resilient',
name: 'Resilient',
config: {
Expand All @@ -90,7 +90,7 @@ export const mockConnectorsResponse = [
referencedByCount: 0,
},
{
id: ids.sn,
id: connectorIds.sn,
actionTypeId: '.servicenow',
name: 'ServiceNow',
config: {
Expand All @@ -108,15 +108,15 @@ export const mockConnectorsResponse = [
referencedByCount: 0,
},
];
export const responses = {
export const executeResponses = {
jira: {
issueTypes: {
status: 'ok',
data: [
{ id: '10006', name: 'Task' },
{ id: '10007', name: 'Sub-task' },
],
actionId: '000e5f86-08b0-4882-adfd-6df981d45c1b',
actionId: connectorIds.jira,
},
fieldsByIssueType: {
status: 'ok',
Expand Down Expand Up @@ -207,7 +207,7 @@ export const responses = {
timetracking: { allowedValues: [], defaultValue: {} },
labels: { allowedValues: [], defaultValue: {} },
},
actionId: '000e5f86-08b0-4882-adfd-6df981d45c1b',
actionId: connectorIds.jira,
},
},
resilient: {
Expand All @@ -217,7 +217,7 @@ export const responses = {
{ id: 17, name: 'Communication error (fax; email)' },
{ id: 21, name: 'Denial of Service' },
],
actionId: 'a6a8dd7f-7e88-48fe-9b9f-70b668da8cbc',
actionId: connectorIds.resilient,
},
severity: {
status: 'ok',
Expand All @@ -226,7 +226,7 @@ export const responses = {
{ id: 5, name: 'Medium' },
{ id: 6, name: 'High' },
],
actionId: 'a6a8dd7f-7e88-48fe-9b9f-70b668da8cbc',
actionId: connectorIds.resilient,
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
* you may not use this file except in compliance with the Elastic License.
*/

import { ids } from '../objects/case';
import { connectorIds } from '../objects/case';

export const CONNECTOR_SELECTOR = '[data-test-subj="dropdown-connectors"]';
export const SELECT_JIRA = `[data-test-subj="dropdown-connector-${ids.jira}"]`;
export const SELECT_RESILIENT = `[data-test-subj="dropdown-connector-${ids.resilient}"]`;
export const SELECT_SN = `[data-test-subj="dropdown-connector-${ids.sn}"]`;
export const SELECT_JIRA = `[data-test-subj="dropdown-connector-${connectorIds.jira}"]`;
export const SELECT_RESILIENT = `[data-test-subj="dropdown-connector-${connectorIds.resilient}"]`;
export const SELECT_SN = `[data-test-subj="dropdown-connector-${connectorIds.sn}"]`;

export const SELECT_ISSUE_TYPE = `[data-test-subj="issueTypeSelect"]`;
export const SELECT_PRIORITY = `[data-test-subj="prioritySelect"]`;
Expand Down

0 comments on commit 8668c64

Please sign in to comment.