-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution][Lists] - Add missing privileges callout to except…
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
...ns/security_solution/cypress/integration/exceptions/all_exception_lists_read_only.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { ROLES } from '../../../common/test'; | ||
import { getExceptionList } from '../../objects/exception'; | ||
import { EXCEPTIONS_TABLE_SHOWING_LISTS } from '../../screens/exceptions'; | ||
import { createExceptionList } from '../../tasks/api_calls/exceptions'; | ||
import { cleanKibana } from '../../tasks/common'; | ||
import { dismissCallOut, getCallOut, waitForCallOutToBeShown } from '../../tasks/common/callouts'; | ||
import { loginAndWaitForPageWithoutDateRange } from '../../tasks/login'; | ||
import { EXCEPTIONS_URL } from '../../urls/navigation'; | ||
|
||
const MISSING_PRIVILEGES_CALLOUT = 'missing-user-privileges'; | ||
|
||
describe('All exception lists - read only', () => { | ||
before(() => { | ||
cleanKibana(); | ||
|
||
// Create exception list not used by any rules | ||
createExceptionList(getExceptionList(), getExceptionList().list_id); | ||
|
||
loginAndWaitForPageWithoutDateRange(EXCEPTIONS_URL, ROLES.reader); | ||
|
||
cy.reload(); | ||
|
||
// Using cy.contains because we do not care about the exact text, | ||
// just checking number of lists shown | ||
cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '1'); | ||
}); | ||
|
||
it('Displays missing privileges primary callout', () => { | ||
waitForCallOutToBeShown(MISSING_PRIVILEGES_CALLOUT, 'primary'); | ||
}); | ||
|
||
context('When a user clicks Dismiss on the callouts', () => { | ||
it('We hide them and persist the dismissal', () => { | ||
waitForCallOutToBeShown(MISSING_PRIVILEGES_CALLOUT, 'primary'); | ||
|
||
dismissCallOut(MISSING_PRIVILEGES_CALLOUT); | ||
cy.reload(); | ||
cy.contains(EXCEPTIONS_TABLE_SHOWING_LISTS, '1'); | ||
|
||
getCallOut(MISSING_PRIVILEGES_CALLOUT).should('not.exist'); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters