@@ -167,66 +167,40 @@ describe('Filters testing', () => {
167167 mode : 'and' ,
168168 filters : [ {
169169 key : [ 'objectLabel' ] ,
170- values : [ 'identity ' ] ,
170+ values : [ 'ryuk ' ] ,
171171 operator : 'only_eq_to' ,
172172 mode : 'or' ,
173173 } ] ,
174174 filterGroups : [ ] ,
175175 } ;
176176 let filteredObjects = await applyFilters ( filters ) ;
177- expect ( filteredObjects . length ) . toBe ( 10 ) ;
178- // With not_only_eq_to
179- let filtersNot = {
180- mode : 'and' ,
181- filters : [ {
182- key : [ 'objectLabel' ] ,
183- values : [ 'attack-pattern' ] ,
184- operator : 'not_only_eq_to' ,
185- mode : 'or' ,
186- } ] ,
187- filterGroups : [ ] ,
188- } ;
189- let filteredObjectsNot = await applyFilters ( filtersNot ) ;
190- expect ( stixBundle . objects . length - filteredObjects . length ) . toBe ( filteredObjectsNot . length ) ;
177+ expect ( filteredObjects . length ) . toBe ( 0 ) ;
191178 // With only_eq_to & AND local mode
192179 filters = {
193180 mode : 'and' ,
194181 filters : [ {
195182 key : [ 'objectLabel' ] ,
196- values : [ 'identity ' , 'organization ' ] ,
183+ values : [ 'ryuk ' , 'TrickBot' , 'COVID-19 '] ,
197184 operator : 'only_eq_to' ,
198185 mode : 'and' ,
199186 } ] ,
200187 filterGroups : [ ] ,
201188 } ;
202189 filteredObjects = await applyFilters ( filters ) ;
203- // With not_only_eq_to & AND local mode
204- filtersNot = {
205- mode : 'and' ,
206- filters : [ {
207- key : [ 'objectLabel' ] ,
208- values : [ 'identity' , 'organization' ] ,
209- operator : 'not_only_eq_to' ,
210- mode : 'and' ,
211- } ] ,
212- filterGroups : [ ] ,
213- } ;
214- filteredObjectsNot = await applyFilters ( filtersNot ) ;
215- expect ( stixBundle . objects . length - filteredObjects . length ) . toBe ( filteredObjectsNot . length ) ;
216- expect ( filteredObjects . map ( ( n ) => n . node . name ) . includes ( 'ANSSI' ) ) . toBeFalsy ( ) ;
190+ expect ( filteredObjects . length ) . toBe ( 2 ) ;
217191 // With only_eq_to & OR local mode
218192 filters = {
219193 mode : 'and' ,
220194 filters : [ {
221195 key : [ 'objectLabel' ] ,
222- values : [ 'identity ' , 'organization ' ] ,
196+ values : [ 'ryuk ' , 'TrickBot' , 'COVID-19 '] ,
223197 operator : 'only_eq_to' ,
224198 mode : 'or' ,
225199 } ] ,
226200 filterGroups : [ ] ,
227201 } ;
228202 filteredObjects = await applyFilters ( filters ) ;
229- expect ( filteredObjects . length ) . toBe ( 10 ) ;
203+ expect ( filteredObjects . length ) . toBe ( 0 ) ;
230204 } ) ;
231205
232206 // revoked
0 commit comments