@@ -35,7 +35,7 @@ describe("Event firing", () => {
3535
3636 cy . get ( "@combo" ) . then ( $combo => {
3737 $combo [ 0 ] . addEventListener ( "focusin" , ( ) => {
38- $combo [ 0 ] . setAttribute ( "open" , "true" ) ;
38+ $combo [ 0 ] . setAttribute ( "open" , "true" ) ;
3939 } ) ;
4040 } ) ;
4141
@@ -74,4 +74,31 @@ describe("Event firing", () => {
7474 cy . get ( "@comboOpened" )
7575 . should ( "have.been.calledTwice" ) ;
7676 } ) ;
77+
78+ it ( "should not fire 'change' event on focusout if value is not changed by user interaction" , ( ) => {
79+ cy . mount (
80+ < >
81+ < ComboBox id = "cb" value = "ComboBox item text" > </ ComboBox >
82+ < ComboBox id = "another-cb" > </ ComboBox >
83+ </ >
84+ ) ;
85+
86+ cy . get ( "#cb" ) . then ( $cb => {
87+ $cb [ 0 ] . addEventListener ( "ui5-change" , cy . stub ( ) . as ( "changeStub" ) ) ;
88+ } ) ;
89+
90+ cy . get ( "#cb" ) . shadow ( ) . find ( "input" ) . click ( ) ;
91+ cy . get ( "#another-cb" ) . shadow ( ) . find ( "input" ) . click ( ) ;
92+ cy . get ( "@changeStub" ) . should ( "not.have.been.called" ) ;
93+
94+ cy . get ( "#cb" ) . then ( ( $cb ) => {
95+ const comboBox = $cb [ 0 ] as ComboBox ;
96+ comboBox . value = "Another ComboBox item text" ;
97+ } ) ;
98+
99+ cy . get ( "#cb" ) . shadow ( ) . find ( "input" ) . click ( ) ;
100+ cy . get ( "#another-cb" ) . shadow ( ) . find ( "input" ) . click ( ) ;
101+ cy . get ( "@changeStub" ) . should ( "not.have.been.called" ) ;
102+ } ) ;
77103} ) ;
104+
0 commit comments