@@ -1465,6 +1465,25 @@ describe('ItemsTests', function () {
1465
1465
Helpers . assertEquals ( "aaa" , json [ 0 ] . data . title ) ;
1466
1466
} ) ;
1467
1467
1468
+ it ( 'test_unfiled' , async function ( ) {
1469
+ await API . userClear ( config . userID ) ;
1470
+
1471
+ let collectionKey = await API . createCollection ( 'Test' , false , this , 'key' ) ;
1472
+ await API . createItem ( "book" , { title : 'aaa' } , this , 'key' ) ;
1473
+ await API . createItem ( "book" , { title : 'bbb' } , this , 'key' ) ;
1474
+
1475
+ await API . createItem ( "book" , { title : 'ccc' , collections : [ collectionKey ] } , this , 'key' ) ;
1476
+ let parentBookInCollection = await API . createItem ( "book" , { title : 'ddd' , collections : [ collectionKey ] } , this , 'key' ) ;
1477
+ await API . createNoteItem ( "some note" , parentBookInCollection , this , 'key' ) ;
1478
+
1479
+ let response = await API . userGet ( config . userID , `items/unfiled?sort=title` ) ;
1480
+ Helpers . assert200 ( response ) ;
1481
+ Helpers . assertNumResults ( response , 2 ) ;
1482
+ let json = API . getJSONFromResponse ( response ) ;
1483
+ Helpers . assertEquals ( "aaa" , json [ 0 ] . data . title ) ;
1484
+ Helpers . assertEquals ( "bbb" , json [ 1 ] . data . title ) ;
1485
+ } ) ;
1486
+
1468
1487
/**
1469
1488
* Date Modified shouldn't be changed if 1) dateModified is provided or 2) certain fields are changed
1470
1489
*/
0 commit comments