@@ -111,8 +111,8 @@ describe("The mouse user", () => {
111111 describe ( "WHEN user clicks SAVE" , ( ) => {
112112 const testFilter = {
113113 column : "currency" ,
114- op : "! =" ,
115- value : "USD " ,
114+ op : "=" ,
115+ value : "EUR " ,
116116 } ;
117117
118118 beforeEach ( ( ) => {
@@ -125,7 +125,17 @@ describe("The mouse user", () => {
125125 />
126126 ) ;
127127 findAddButton ( ) . realClick ( ) ;
128- clickListItems ( testFilter . column , testFilter . op , testFilter . value ) ;
128+ cy . findAllByRole ( "combobox" ) . eq ( 0 ) . should ( "be.focused" ) ;
129+ cy . findByRole ( "option" , { name : "currency" } ) . realHover ( ) ;
130+ cy . findByRole ( "option" , { name : "currency" } ) . realClick ( ) ;
131+ cy . findAllByRole ( "combobox" ) . eq ( 1 ) . should ( "be.focused" ) ;
132+ cy . findByRole ( "option" , { name : "=" } ) . realHover ( ) ;
133+ cy . findByRole ( "option" , { name : "=" } ) . realClick ( ) ;
134+ cy . findAllByRole ( "combobox" ) . eq ( 2 ) . should ( "be.focused" ) ;
135+ cy . findByRole ( "option" , { name : "EUR" } ) . realHover ( ) ;
136+ cy . findByRole ( "option" , { name : "EUR" } ) . realClick ( ) ;
137+ cy . findByRole ( "button" , { name : "Save" } ) . should ( "be.focused" ) ;
138+
129139 clickButton ( "Save" ) ;
130140 } ) ;
131141
@@ -138,7 +148,7 @@ describe("The mouse user", () => {
138148
139149 it ( "THEN filter is applied" , ( ) => {
140150 cy . get ( "@applyFilterHandler" ) . should ( "be.calledWith" , {
141- filter : 'currency ! = "USD "' ,
151+ filter : 'currency = "EUR "' ,
142152 filterStruct : testFilter ,
143153 } ) ;
144154 } ) ;
@@ -198,15 +208,24 @@ describe("The mouse user", () => {
198208 . find ( ".vuuSplitButton-trigger" )
199209 . realClick ( ) ;
200210 clickButton ( "Edit" ) ;
201- clickListItems ( newFilter . column , newFilter . op , newFilter . value ) ;
211+ cy . findAllByRole ( "combobox" ) . eq ( 0 ) . should ( "be.focused" ) ;
212+ cy . findByRole ( "option" , { name : "currency" } ) . realHover ( ) ;
213+ cy . findByRole ( "option" , { name : "currency" } ) . realClick ( ) ;
214+ cy . findAllByRole ( "combobox" ) . eq ( 1 ) . should ( "be.focused" ) ;
215+ cy . findByRole ( "option" , { name : "=" } ) . realHover ( ) ;
216+ cy . findByRole ( "option" , { name : "=" } ) . realClick ( ) ;
217+ cy . findAllByRole ( "combobox" ) . eq ( 2 ) . should ( "be.focused" ) ;
218+ cy . findByRole ( "option" , { name : "CAD" } ) . realHover ( ) ;
219+ cy . findByRole ( "option" , { name : "CAD" } ) . realClick ( ) ;
220+ cy . findByRole ( "button" , { name : "Save" } ) . should ( "be.focused" ) ;
202221 clickButton ( "Save" ) ;
203222
204223 cy . get ( "@filterStateChangeHandler" ) . should ( "be.calledWithExactly" , {
205224 filters : [ newFilter ] ,
206225 activeIndices : [ 0 ] ,
207226 } ) ;
208227 cy . get ( "@applyFilterHandler" ) . should ( "be.calledWithExactly" , {
209- filter : 'currency ! = "CAD"' ,
228+ filter : 'currency = "CAD"' ,
210229 filterStruct : newFilter ,
211230 } ) ;
212231 } ) ;
@@ -237,13 +256,31 @@ describe("The mouse user", () => {
237256 />
238257 ) ;
239258 findAddButton ( ) . realClick ( ) ;
240- clickListItems ( filter1 . column , filter1 . op , filter1 . value ) ;
259+ cy . findAllByRole ( "combobox" ) . eq ( 0 ) . should ( "be.focused" ) ;
260+ cy . findByRole ( "option" , { name : filter1 . column } ) . realHover ( ) ;
261+ cy . findByRole ( "option" , { name : filter1 . column } ) . realClick ( ) ;
262+ cy . findAllByRole ( "combobox" ) . eq ( 1 ) . should ( "be.focused" ) ;
263+ cy . findByRole ( "option" , { name : filter1 . op } ) . realHover ( ) ;
264+ cy . findByRole ( "option" , { name : filter1 . op } ) . realClick ( ) ;
265+ cy . findAllByRole ( "combobox" ) . eq ( 2 ) . should ( "be.focused" ) ;
266+ cy . findByRole ( "option" , { name : filter1 . value } ) . realHover ( ) ;
267+ cy . findByRole ( "option" , { name : filter1 . value } ) . realClick ( ) ;
268+ cy . findByRole ( "button" , { name : "Save" } ) . should ( "be.focused" ) ;
241269 clickButton ( "Save" ) ;
242270 waitUntilEditableLabelIsFocused ( ) ;
243271 pressEnterEditableLabel ( ) ;
244272
245273 findAddButton ( ) . realClick ( ) ;
246- clickListItems ( filter2 . column , filter2 . op , filter2 . value ) ;
274+ cy . findAllByRole ( "combobox" ) . eq ( 0 ) . should ( "be.focused" ) ;
275+ cy . findByRole ( "option" , { name : filter2 . column } ) . realHover ( ) ;
276+ cy . findByRole ( "option" , { name : filter2 . column } ) . realClick ( ) ;
277+ cy . findAllByRole ( "combobox" ) . eq ( 1 ) . should ( "be.focused" ) ;
278+ cy . findByRole ( "option" , { name : filter2 . op } ) . realHover ( ) ;
279+ cy . findByRole ( "option" , { name : filter2 . op } ) . realClick ( ) ;
280+ cy . findAllByRole ( "combobox" ) . eq ( 2 ) . should ( "be.focused" ) ;
281+ cy . findByRole ( "option" , { name : filter2 . value } ) . realHover ( ) ;
282+ cy . findByRole ( "option" , { name : filter2 . value } ) . realClick ( ) ;
283+ cy . findByRole ( "button" , { name : "Save" } ) . should ( "be.focused" ) ;
247284 clickButton ( "Save" ) ;
248285 waitUntilEditableLabelIsFocused ( 1 ) ;
249286 pressEnterEditableLabel ( 1 ) ;
@@ -446,7 +483,7 @@ const getDate = (t: "start-today" | "start-tomorrow" | "end-today") => {
446483 }
447484} ;
448485
449- describe ( "WHEN a user applies a date filter" , ( ) => {
486+ describe . only ( "WHEN a user applies a date filter" , ( ) => {
450487 const DATE_COLUMN = "lastUpdated" ;
451488 const startOfToday = getDate ( "start-today" ) . getTime ( ) ;
452489 const endOfToday = getDate ( "end-today" ) . getTime ( ) ;
@@ -513,7 +550,10 @@ describe("WHEN a user applies a date filter", () => {
513550 // Add date filter
514551 findAddButton ( ) . realClick ( ) ;
515552 clickListItems ( DATE_COLUMN , op ) ;
516- cy . get ( ".vuuDatePopup .vuuIconButton" ) . realClick ( ) ;
553+ cy . findByRole ( "textbox" , { name : "Start date" } ) . should ( "be.focused" ) ;
554+ cy . realPress ( "ArrowDown" )
555+
556+ // cy.get(".vuuDatePopup .vuuIconButton").realClick();
517557 cy . get ( `${ VISIBLE_MONTH } .saltCalendarDay-today` ) . realClick ( ) ;
518558 cy . realPress ( "ArrowRight" ) ;
519559 clickButton ( "Save" ) ;
0 commit comments