@@ -31,34 +31,57 @@ describe('Application', () => {
31
31
32
32
it ( 'filter rows with multiple filters' , ( ) => {
33
33
home . visit ( ) ;
34
+ // First filter by name
34
35
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 ) ;
37
44
cy . get ( "[id$='workspaces-table-row-1']" ) . contains ( 'My First Jupyter Notebook' ) ;
38
45
} ) ;
39
46
40
47
it ( 'filter rows with multiple filters and remove one' , ( ) => {
41
48
home . visit ( ) ;
49
+ // Add name filter
42
50
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 ) ;
45
52
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' ) ;
48
64
cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
49
65
cy . get ( "[id$='workspaces-table-row-1']" ) . contains ( 'My First Jupyter Notebook' ) ;
50
66
cy . get ( "[id$='workspaces-table-row-2']" ) . contains ( 'My Second Jupyter Notebook' ) ;
51
67
} ) ;
52
68
53
69
it ( 'filter rows with multiple filters and remove all' , ( ) => {
54
70
home . visit ( ) ;
71
+ // Add name filter
55
72
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 ) ;
58
74
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
59
82
cy . get ( '*' ) . contains ( 'Clear all filters' ) . click ( ) ;
60
- cy . get ( "[class$='pf-v6-c-toolbar__group']" ) . should ( 'not.contain' , 'Pod Config' ) ;
61
83
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' ) ;
62
85
cy . get ( "[id$='workspaces-table-content']" ) . find ( 'tr' ) . should ( 'have.length' , 2 ) ;
63
86
} ) ;
64
87
} ) ;
0 commit comments