@@ -31,34 +31,57 @@ describe('Application', () => {
3131
3232 it ( 'filter rows with multiple filters' , ( ) => {
3333 home . visit ( ) ;
34+ // First filter by name
3435 useFilter ( 'name' , 'Name' , 'My' ) ;
35- useFilter ( 'podConfig' , 'Pod Config' , 'Tiny' ) ;
36- cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 1 ) ;
36+ cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
37+ cy . get ( "[id$='workspaces-table-row-1']" ) . contains ( 'My First Jupyter Notebook' ) ;
38+
39+ // Add second filter by image
40+ useFilter ( 'image' , 'Image' , 'jupyter' ) ;
41+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . contains ( 'Name' ) ;
42+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . contains ( 'Image' ) ;
43+ cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
3744 cy . get ( "[id$='workspaces-table-row-1']" ) . contains ( 'My First Jupyter Notebook' ) ;
3845 } ) ;
3946
4047 it ( 'filter rows with multiple filters and remove one' , ( ) => {
4148 home . visit ( ) ;
49+ // Add name filter
4250 useFilter ( 'name' , 'Name' , 'My' ) ;
43- useFilter ( 'podConfig' , 'Pod Config' , 'Tiny' ) ;
44- cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 1 ) ;
51+ cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
4552 cy . get ( "[id$='workspaces-table-row-1']" ) . contains ( 'My First Jupyter Notebook' ) ;
46- cy . get ( "[class$='pf-v6-c-label-group__close']" ) . eq ( 1 ) . click ( ) ;
47- cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . should ( 'not.contain' , 'Pod Config' ) ;
53+
54+ // Add image filter
55+ useFilter ( 'image' , 'Image' , 'jupyter' ) ;
56+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . contains ( 'Name' ) ;
57+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . contains ( 'Image' ) ;
58+ cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
59+
60+ // Remove one filter (the first one)
61+ cy . get ( "[class$='pf-v6-c-label-group__close']" ) . first ( ) . click ( ) ;
62+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . should ( 'not.contain' , 'Name' ) ;
63+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . contains ( 'Image' ) ;
4864 cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
4965 cy . get ( "[id$='workspaces-table-row-1']" ) . contains ( 'My First Jupyter Notebook' ) ;
5066 cy . get ( "[id$='workspaces-table-row-2']" ) . contains ( 'My Second Jupyter Notebook' ) ;
5167 } ) ;
5268
5369 it ( 'filter rows with multiple filters and remove all' , ( ) => {
5470 home . visit ( ) ;
71+ // Add name filter
5572 useFilter ( 'name' , 'Name' , 'My' ) ;
56- useFilter ( 'podConfig' , 'Pod Config' , 'Tiny' ) ;
57- cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 1 ) ;
73+ cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
5874 cy . get ( "[id$='workspaces-table-row-1']" ) . contains ( 'My First Jupyter Notebook' ) ;
75+
76+ // Add image filter
77+ useFilter ( 'image' , 'Image' , 'jupyter' ) ;
78+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . contains ( 'Name' ) ;
79+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . contains ( 'Image' ) ;
80+
81+ // Clear all filters
5982 cy . get ( '*' ) . contains ( 'Clear all filters' ) . click ( ) ;
60- cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . should ( 'not.contain' , 'Pod Config' ) ;
6183 cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . should ( 'not.contain' , 'Name' ) ;
84+ cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . should ( 'not.contain' , 'Image' ) ;
6285 cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
6386 } ) ;
6487} ) ;
0 commit comments