File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
app/code/Magento/Ui/view/base/web/js/grid/columns
dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/grid/columns Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ define([
167
167
* Close image preview
168
168
*/
169
169
hide : function ( ) {
170
- this . lastOpenedImage ( null ) ;
170
+ this . lastOpenedImage ( false ) ;
171
171
this . visibleRecord ( null ) ;
172
172
this . height ( 0 ) ;
173
173
this . _selectRow ( null ) ;
Original file line number Diff line number Diff line change @@ -51,14 +51,18 @@ define([
51
51
imagePreview . visibleRecord = ko . observable ( 1 ) ;
52
52
} ) ;
53
53
54
- describe ( 'show method' , function ( ) {
54
+ describe ( 'verify show && hide record' , function ( ) {
55
+
55
56
it ( 'show image' , function ( ) {
56
- var mockImg = document . createElement ( 'img' ) ,
57
- hide = spyOn ( imagePreview , 'hide' ) ;
57
+ var mockImg = document . createElement ( 'img' ) ;
58
58
59
+ imagePreview . visibleRecord ( 2 ) ;
59
60
spyOn ( $ . fn , 'get' ) . and . returnValue ( mockImg ) ;
60
61
imagePreview . show ( record ) ;
61
- expect ( hide ) . toHaveBeenCalledTimes ( 1 ) ;
62
+ expect ( imagePreview . lastOpenedImage ( ) ) . toBe ( record . _rowIndex ) ;
63
+
64
+ imagePreview . hide ( ) ;
65
+ expect ( imagePreview . lastOpenedImage ( ) ) . toBe ( false ) ;
62
66
} ) ;
63
67
64
68
} ) ;
You can’t perform that action at this time.
0 commit comments