@@ -242,17 +242,17 @@ describe('Combobox', () => {
242242 expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'true' ) ;
243243 } ) ;
244244
245- it ( 'should clear the completion string and not close on escape when a completion is present ' , ( ) => {
245+ it ( 'should close then clear the completion string ' , ( ) => {
246246 fixture . componentInstance . filterMode . set ( 'highlight' ) ;
247247 focus ( ) ;
248248 input ( 'A' ) ;
249249 expect ( inputElement . value ) . toBe ( 'Alabama' ) ;
250250 expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'true' ) ;
251251 escape ( ) ;
252- expect ( inputElement . value ) . toBe ( 'A ' ) ;
253- expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'true ' ) ;
252+ expect ( inputElement . value ) . toBe ( 'Alabama ' ) ;
253+ expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'false ' ) ; // close
254254 escape ( ) ;
255- expect ( inputElement . value ) . toBe ( 'A ' ) ;
255+ expect ( inputElement . value ) . toBe ( '' ) ; // clear input
256256 expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'false' ) ;
257257 } ) ;
258258
@@ -929,17 +929,17 @@ describe('Combobox', () => {
929929 expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'true' ) ;
930930 } ) ;
931931
932- it ( 'should clear the completion string and not close on escape when a completion is present ' , ( ) => {
932+ it ( 'should close then clear the completion string ' , ( ) => {
933933 fixture . componentInstance . filterMode . set ( 'highlight' ) ;
934934 focus ( ) ;
935935 input ( 'Mar' ) ;
936936 expect ( inputElement . value ) . toBe ( 'March' ) ;
937937 expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'true' ) ;
938938 escape ( ) ;
939- expect ( inputElement . value ) . toBe ( 'Mar ' ) ;
940- expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'true ' ) ;
939+ expect ( inputElement . value ) . toBe ( 'March ' ) ;
940+ expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'false ' ) ; // close
941941 escape ( ) ;
942- expect ( inputElement . value ) . toBe ( 'Mar ' ) ;
942+ expect ( inputElement . value ) . toBe ( '' ) ; // clear input
943943 expect ( inputElement . getAttribute ( 'aria-expanded' ) ) . toBe ( 'false' ) ;
944944 } ) ;
945945
0 commit comments