[Security Solution][Endpoint][Admin] malware custom notify user message tests (#87603)

This commit is contained in:
Candace Park 2021-01-07 13:44:51 -05:00 committed by GitHub
parent 19687765b1
commit cf641f7303
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -67,6 +67,42 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
});
});
describe('on the Malware protections section', () => {
let policyInfo: PolicyTestResourceInfo;
beforeEach(async () => {
policyInfo = await policyTestResources.createPolicy();
await pageObjects.policy.navigateToPolicyDetails(policyInfo.packagePolicy.id);
await testSubjects.existOrFail('malwareProtectionsForm');
});
afterEach(async () => {
if (policyInfo) {
await policyInfo.cleanup();
}
});
it('should show the custom message text area when the Notify User checkbox is checked', async () => {
expect(await testSubjects.isChecked('malwareUserNotificationCheckbox')).to.be(true);
await testSubjects.existOrFail('malwareUserNotificationCustomMessage');
});
it('should not show the custom message text area when the Notify User checkbox is unchecked', async () => {
await pageObjects.endpointPageUtils.clickOnEuiCheckbox('malwareUserNotificationCheckbox');
expect(await testSubjects.isChecked('malwareUserNotificationCheckbox')).to.be(false);
await testSubjects.missingOrFail('malwareUserNotificationCustomMessage');
});
it('should preserve a custom notification message upon saving', async () => {
const customMessage = await testSubjects.find('malwareUserNotificationCustomMessage');
await customMessage.clearValue();
await customMessage.type('a custom malware notification message');
await pageObjects.policy.confirmAndSave();
await testSubjects.existOrFail('policyDetailsSuccessMessage');
expect(await testSubjects.getVisibleText('malwareUserNotificationCustomMessage')).to.equal(
'a custom malware notification message'
);
});
});
describe('and the save button is clicked', () => {
let policyInfo: PolicyTestResourceInfo;