@@ -214,6 +214,11 @@ describe('Lists', () => {
214214 const recordType = 'Instances' ;
215215 const testData = {
216216 instanceTitle : getTestEntityValue ( 'C_lists_query_builder_classification_instance' ) ,
217+ uuidInstanceTitles : [
218+ getTestEntityValue ( 'C446019_Instance_1' ) ,
219+ getTestEntityValue ( 'C446019_Instance_2' ) ,
220+ ] ,
221+ instanceIds : [ ] ,
217222 classificationNumber : 'BJ1533.C4' ,
218223 classificationIdentifierTypeName : getTestEntityValue (
219224 'C_lists_query_builder_classification_type' ,
@@ -243,6 +248,17 @@ describe('Lists', () => {
243248 } ,
244249 } ) . then ( ( { instanceId } ) => {
245250 testData . instanceId = instanceId ;
251+ testData . instanceIds . push ( instanceId ) ;
252+ } ) ;
253+ testData . uuidInstanceTitles . forEach ( ( title ) => {
254+ InventoryInstances . createFolioInstanceViaApi ( {
255+ instance : {
256+ instanceTypeId : instanceTypes [ 0 ] . id ,
257+ title,
258+ } ,
259+ } ) . then ( ( { instanceId } ) => {
260+ testData . instanceIds . push ( instanceId ) ;
261+ } ) ;
246262 } ) ;
247263 } ) ;
248264 createQueryBuilderUser (
@@ -255,6 +271,11 @@ describe('Lists', () => {
255271 cy . getAdminToken ( ) ;
256272 Users . deleteViaApi ( userData . userId ) ;
257273 InventoryInstance . deleteInstanceViaApi ( testData . instanceId ) ;
274+ testData . instanceIds
275+ . filter ( ( instanceId ) => instanceId !== testData . instanceId )
276+ . forEach ( ( instanceId ) => {
277+ InventoryInstance . deleteInstanceViaApi ( instanceId ) ;
278+ } ) ;
258279 ClassificationIdentifierTypes . deleteViaApi ( testData . classificationIdentifierTypeId ) ;
259280 } ) ;
260281
@@ -342,6 +363,65 @@ describe('Lists', () => {
342363 } ,
343364 ) ;
344365
366+ it (
367+ 'C446019 The IN operator is rendered correctly in the query builder when editing existing queries (corsair)' ,
368+ { tags : [ 'criticalPath' , 'corsair' , 'C446019' ] } ,
369+ ( ) => {
370+ const recordAmount = 3 ;
371+ const instanceIds = testData . instanceIds ;
372+ const value = instanceIds . join ( ',' ) ;
373+ const formattedValue = instanceIds . join ( ', ' ) ;
374+ const expectedQuery = `(instance.id in (${ formattedValue } ))` ;
375+
376+ listName = getTestEntityValue ( 'C446019_List' ) ;
377+ openQueryBuilder ( recordType ) ;
378+
379+ QueryModal . selectField ( instanceFieldValues . instanceId ) ;
380+ QueryModal . verifySelectedField ( instanceFieldValues . instanceId ) ;
381+ QueryModal . selectOperator ( QUERY_OPERATIONS . IN ) ;
382+ QueryModal . fillInValueTextfield ( value ) ;
383+ QueryModal . verifyTextFieldValue ( value ) ;
384+ QueryModal . verifyQueryAreaContent ( expectedQuery ) ;
385+ QueryModal . testQueryDisabled ( false ) ;
386+ QueryModal . runQueryDisabled ( ) ;
387+
388+ QueryModal . clickTestQuery ( ) ;
389+ QueryModal . verifyPreviewOfRecordsMatched ( ) ;
390+ QueryModal . verifyNumberOfMatchedRecords ( recordAmount ) ;
391+ instanceIds . forEach ( ( instanceId ) => {
392+ QueryModal . verifyRecordWithContent ( instanceId ) ;
393+ } ) ;
394+
395+ QueryModal . clickRunQueryAndSave ( ) ;
396+ QueryModal . verifyClosed ( ) ;
397+ Lists . verifySuccessCalloutMessage ( `List ${ listName } saved.` ) ;
398+ Lists . waitForCompilingAnimationToDisappear ( ) ;
399+ Lists . verifyRefreshCompleteCallout ( recordAmount ) ;
400+ Lists . viewUpdatedList ( ) ;
401+ Lists . verifyRecordsNumber ( recordAmount ) ;
402+ instanceIds . forEach ( ( instanceId ) => {
403+ Lists . verifyRecordWithContent ( instanceId ) ;
404+ } ) ;
405+
406+ Lists . openActions ( ) ;
407+ Lists . editList ( ) ;
408+ Lists . editQuery ( ) ;
409+ QueryModal . verifySelectedField ( instanceFieldValues . instanceId ) ;
410+ QueryModal . verifySelectedOperator ( QUERY_OPERATIONS . IN ) ;
411+ QueryModal . verifyTextFieldValue ( value ) ;
412+ QueryModal . verifyQueryAreaDoesNotContain ( 'undefined' ) ;
413+ QueryModal . testQueryDisabled ( false ) ;
414+ QueryModal . runQueryDisabled ( ) ;
415+
416+ QueryModal . clickTestQuery ( ) ;
417+ QueryModal . verifyPreviewOfRecordsMatched ( ) ;
418+ QueryModal . verifyNumberOfMatchedRecords ( recordAmount ) ;
419+ instanceIds . forEach ( ( instanceId ) => {
420+ QueryModal . verifyRecordWithContent ( instanceId ) ;
421+ } ) ;
422+ } ,
423+ ) ;
424+
345425 it (
346426 'Search instances in the query builder by classification identifier type (corsair)' ,
347427 { tags : [ 'criticalPath' , 'corsair' ] } ,
0 commit comments