[Security Solution][Endpoint][Policy] Automate policy tests (#117741) (#118049)

Co-authored-by: Candace Park <56409205+parkiino@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2021-11-09 14:46:52 -05:00 committed by GitHub
parent 90b3416c55
commit 2d0eec656c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View file

@ -1086,6 +1086,11 @@ describe('when on the endpoint list page', () => {
).toBe('Policy Response');
});
it('should display timestamp', () => {
const timestamp = renderResult.queryByTestId('endpointDetailsPolicyResponseTimestamp');
expect(timestamp).not.toBeNull();
});
it('should show a configuration section for each protection', async () => {
const configAccordions = await renderResult.findAllByTestId(
'endpointDetailsPolicyResponseConfigAccordion'

View file

@ -17,7 +17,7 @@ export const SupportedVersionNotice = ({ optionName }: { optionName: string }) =
}
return (
<EuiText color="subdued" size="xs">
<EuiText color="subdued" size="xs" data-test-subj="policySupportedVersions">
<i>
<FormattedMessage
id="xpack.securitySolution.endpoint.policyDetails.supportedVersion"

View file

@ -15,6 +15,7 @@ import { FullAgentPolicyInput } from '../../../../plugins/fleet/common';
import { PolicyConfig } from '../../../../plugins/security_solution/common/endpoint/types';
import { ManifestSchema } from '../../../../plugins/security_solution/common/endpoint/schema/manifest';
import { policyFactory } from '../../../../plugins/security_solution/common/endpoint/models/policy_config';
import { popupVersionsMap } from '../../../../plugins/security_solution/public/management/pages/policy/view/policy_forms/protections/popup_options_to_versions';
export default function ({ getPageObjects, getService }: FtrProviderContext) {
const browser = getService('browser');
@ -307,6 +308,11 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) {
}
});
it('should show the supported Endpoint version', async () => {
const supportedVersion = await testSubjects.find('policySupportedVersions');
expect(supportedVersion).to.be('Agent version ' + popupVersionsMap.get('malware'));
});
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');