File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
app/code/Magento/Ui/view/base/web/js/grid/search
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/search Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ define([
127
127
apply : function ( value ) {
128
128
value = value || this . inputValue ;
129
129
130
- this . keywordUpdated = this . value !== this . inputValue ;
130
+ this . keywordUpdated = this . value !== value ;
131
131
this . value = this . inputValue = value . trim ( ) ;
132
132
133
133
return this ;
Original file line number Diff line number Diff line change @@ -37,5 +37,15 @@ define([
37
37
searchObj . updatePreview ( ) ;
38
38
expect ( searchObj . updatePreview ) . toHaveBeenCalled ( ) ;
39
39
} ) ;
40
+ it ( 'set the proper keywordUpdated value on new search keyword' , function ( ) {
41
+ searchObj . value = 'keyword 1' ;
42
+ expect ( searchObj . keywordUpdated ) . toEqual ( false ) ;
43
+ searchObj . apply ( 'keyword 2' ) ;
44
+ expect ( searchObj . keywordUpdated ) . toEqual ( true ) ;
45
+ searchObj . apply ( 'keyword 2' ) ;
46
+ expect ( searchObj . keywordUpdated ) . toEqual ( false ) ;
47
+ searchObj . apply ( 'keyword 3' ) ;
48
+ expect ( searchObj . keywordUpdated ) . toEqual ( true ) ;
49
+ } ) ;
40
50
} ) ;
41
51
} ) ;
You can’t perform that action at this time.
0 commit comments