@@ -296,6 +296,28 @@ describe('List View', () => {
296
296
} )
297
297
298
298
describe ( 'filters' , ( ) => {
299
+ test ( 'should not close where builder when clearing final condition' , async ( ) => {
300
+ await page . goto ( postsUrl . list )
301
+ await openListFilters ( page , { } )
302
+ await page . locator ( '.where-builder__add-first-filter' ) . click ( )
303
+ await page . locator ( '.condition__field' ) . click ( )
304
+ await page . locator ( '.rs__option' , { hasText : exactText ( 'Relationship' ) } ) . click ( )
305
+ await page . locator ( '.condition__operator' ) . click ( )
306
+ await page . locator ( '.rs__option' , { hasText : exactText ( 'equals' ) } ) . click ( )
307
+ const valueInput = await page . locator ( '.condition__value' )
308
+ await valueInput . click ( )
309
+ await valueInput . locator ( '.rs__option' ) . first ( ) . click ( )
310
+
311
+ await page . waitForURL ( / & w h e r e / )
312
+
313
+ await page . locator ( '.condition__actions .btn.condition__actions-remove' ) . click ( )
314
+
315
+ await page . waitForURL ( / ^ (? ! .* & w h e r e ) / )
316
+
317
+ const whereBuilder = page . locator ( '.list-controls__where.rah-static.rah-static--height-auto' )
318
+ await expect ( whereBuilder ) . toBeVisible ( )
319
+ } )
320
+
299
321
test ( 'should respect base list filters' , async ( ) => {
300
322
await page . goto ( baseListFiltersUrl . list )
301
323
await page . waitForURL ( ( url ) => url . toString ( ) . startsWith ( baseListFiltersUrl . list ) )
@@ -382,8 +404,7 @@ describe('List View', () => {
382
404
383
405
await page . waitForURL ( / & w h e r e / )
384
406
385
- const valueInput = page . locator ( '.condition__value' )
386
- const removeButton = valueInput . locator ( '.clear-indicator' ) . click ( )
407
+ page . locator ( '.condition__value' ) . locator ( '.clear-indicator' ) . click ( )
387
408
388
409
await page . waitForURL ( / ^ (? ! .* & w h e r e ) / )
389
410
} )
@@ -662,10 +683,8 @@ describe('List View', () => {
662
683
condition2 ?. locator ( '.rs__menu-list:has-text("Disable List Filter Text")' ) ,
663
684
) . toBeHidden ( )
664
685
} )
665
- } )
666
686
667
- describe ( 'WhereBuilder' , ( ) => {
668
- test ( 'should render where builder' , async ( ) => {
687
+ test ( 'should properly paginate many documents' , async ( ) => {
669
688
await page . goto (
670
689
`${ with300DocumentsUrl . list } ?limit=10&page=1&where%5Bor%5D%5B0%5D%5Band%5D%5B0%5D%5BselfRelation%5D%5Bequals%5D=null` ,
671
690
)
0 commit comments