Skip to content

Commit

Permalink
refactors 'exceptions table' tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MadameSheema committed Sep 22, 2021
1 parent 643a8b4 commit 78feee8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@ import {
waitForPageWithoutDateRange,
} from '../../tasks/login';
import {
activatesRule,
addsExceptionFromRuleSettings,
goBackToAllRulesTable,
goToExceptionsTab,
waitForTheRuleToBeExecuted,
} from '../../tasks/rule_details';

import { ALERTS_URL, EXCEPTIONS_URL } from '../../urls/navigation';
Expand Down Expand Up @@ -59,12 +57,9 @@ describe('Exceptions Table', () => {

esArchiverLoad('auditbeat_for_exceptions');

activatesRule();

// Add a detections exception list
goToExceptionsTab();
addsExceptionFromRuleSettings(getException());
waitForTheRuleToBeExecuted();

// Create exception list not used by any rules
createExceptionList(getExceptionList(), getExceptionList().list_id).as('exceptionListResponse');
Expand Down Expand Up @@ -116,7 +111,7 @@ describe('Exceptions Table', () => {
cy.get(EXCEPTIONS_TABLE_SHOWING_LISTS).should('have.text', `Showing 3 lists`);
});

it.skip('Exports exception list', function () {
it('Exports exception list', function () {
cy.intercept(/(\/api\/exception_lists\/_export)/).as('export');

waitForPageWithoutDateRange(EXCEPTIONS_URL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@ export const expectedExportedExceptionList = (
): string => {
const jsonrule = exceptionListResponse.body;

return `"{\\"_version\\":\\"${jsonrule._version}\\",\\"created_at\\":\\"${jsonrule.created_at}\\",\\"created_by\\":\\"elastic\\",\\"description\\":\\"${jsonrule.description}\\",\\"id\\":\\"${jsonrule.id}\\",\\"immutable\\":false,\\"list_id\\":\\"test_exception_list\\",\\"name\\":\\"Test exception list\\",\\"namespace_type\\":\\"single\\",\\"os_types\\":[],\\"tags\\":[],\\"tie_breaker_id\\":\\"${jsonrule.tie_breaker_id}\\",\\"type\\":\\"detection\\",\\"updated_at\\":\\"${jsonrule.updated_at}\\",\\"updated_by\\":\\"elastic\\",\\"version\\":1}\n"\n""\n{"exception_list_items_details":"{\\"exported_count\\":0}\n"}\n`;
return `"{\\"_version\\":\\"${jsonrule._version}\\",\\"created_at\\":\\"${jsonrule.created_at}\\",\\"created_by\\":\\"elastic\\",\\"description\\":\\"${jsonrule.description}\\",\\"id\\":\\"${jsonrule.id}\\",\\"immutable\\":false,\\"list_id\\":\\"test_exception_list\\",\\"name\\":\\"Test exception list\\",\\"namespace_type\\":\\"single\\",\\"os_types\\":[],\\"tags\\":[],\\"tie_breaker_id\\":\\"${jsonrule.tie_breaker_id}\\",\\"type\\":\\"detection\\",\\"updated_at\\":\\"${jsonrule.updated_at}\\",\\"updated_by\\":\\"elastic\\",\\"version\\":1}\\n"\n""\n{"exception_list_items_details":"{\\"exported_count\\":0}\\n"}\n`;
};

0 comments on commit 78feee8

Please sign in to comment.