@@ -9,6 +9,7 @@ import type TestAgent from 'supertest/lib/agent';
99import expect from '@kbn/expect' ;
1010import {
1111 ENDPOINT_ARTIFACT_LISTS ,
12+ ENDPOINT_LIST_ID ,
1213 EXCEPTION_LIST_ITEM_URL ,
1314 EXCEPTION_LIST_URL ,
1415} from '@kbn/securitysolution-list-constants' ;
@@ -35,7 +36,7 @@ export default function ({ getService }: FtrProviderContext) {
3536
3637 describe ( `and using Import API` , function ( ) {
3738 const buildImportBuffer = (
38- listId : ( typeof ALL_ENDPOINT_ARTIFACT_LIST_IDS ) [ number ]
39+ listId : ( typeof ALL_ENDPOINT_ARTIFACT_LIST_IDS ) [ number ] | typeof ENDPOINT_LIST_ID
3940 ) : Buffer => {
4041 const generator = new ExceptionsListItemGenerator ( ) ;
4142 const listInfo = Object . values ( ENDPOINT_ARTIFACT_LISTS ) . find ( ( listDefinition ) => {
@@ -48,7 +49,7 @@ export default function ({ getService }: FtrProviderContext) {
4849
4950 const createItem = ( ) => {
5051 switch ( listId ) {
51- case ENDPOINT_ARTIFACT_LISTS . endpointExceptions . id :
52+ case ENDPOINT_LIST_ID :
5253 return generator . generateEndpointException ( ) ;
5354
5455 case ENDPOINT_ARTIFACT_LISTS . blocklists . id :
@@ -63,9 +64,6 @@ export default function ({ getService }: FtrProviderContext) {
6364 case ENDPOINT_ARTIFACT_LISTS . trustedApps . id :
6465 return generator . generateTrustedApp ( ) ;
6566
66- case ENDPOINT_ARTIFACT_LISTS . trustedDevices . id :
67- return generator . generateTrustedDevice ( ) ;
68-
6967 default :
7068 throw new Error ( `Unknown listId: ${ listId } . Unable to generate exception list item.` ) ;
7169 }
@@ -88,9 +86,7 @@ ${JSON.stringify(createItem())}
8886 } ;
8987
9088 // All non-Endpoint exceptions artifacts are not allowed to import
91- ALL_ENDPOINT_ARTIFACT_LIST_IDS . filter (
92- ( listId ) => listId !== ENDPOINT_ARTIFACT_LISTS . endpointExceptions . id
93- ) . forEach ( ( listId ) => {
89+ ALL_ENDPOINT_ARTIFACT_LIST_IDS . forEach ( ( listId ) => {
9490 it ( `should error when importing ${ listId } artifacts` , async ( ) => {
9591 await endpointArtifactTestResources . deleteList ( listId ) ;
9692
@@ -108,19 +104,13 @@ ${JSON.stringify(createItem())}
108104 } ) ;
109105
110106 it ( 'should import endpoint exceptions and add global artifact tag if missing' , async ( ) => {
111- await endpointArtifactTestResources . deleteList (
112- ENDPOINT_ARTIFACT_LISTS . endpointExceptions . id
113- ) ;
107+ await endpointArtifactTestResources . deleteList ( ENDPOINT_LIST_ID ) ;
114108
115109 await endpointOpsAnalystSupertest
116110 . post ( `${ EXCEPTION_LIST_URL } /_import` )
117111 . set ( 'kbn-xsrf' , 'true' )
118112 . on ( 'error' , createSupertestErrorLogger ( log ) )
119- . attach (
120- 'file' ,
121- buildImportBuffer ( ENDPOINT_ARTIFACT_LISTS . endpointExceptions . id ) ,
122- 'import_exceptions.ndjson'
123- )
113+ . attach ( 'file' , buildImportBuffer ( ENDPOINT_LIST_ID ) , 'import_exceptions.ndjson' )
124114 . expect ( 200 ) ;
125115
126116 const { body } = await endpointOpsAnalystSupertest
0 commit comments