@@ -28,9 +28,9 @@ define(['magnifier/magnify', 'mage/gallery/gallery', 'jquery'], function (Magnif
28
28
breakpoints : { "mobile" :{ "conditions" :{ "max-width" :"767px" } , "options" :{ "options" :{ "nav" :"dots" } } } } ,
29
29
data : [
30
30
{
31
- "thumb" :"/images/sample .jpg" ,
32
- "img" :"/images/sample .jpg" ,
33
- "full" :"/images/sample .jpg" ,
31
+ "thumb" :"dev/tests/acceptance/tests/_data/adobe-base .jpg" ,
32
+ "img" :"dev/tests/acceptance/tests/_data/adobe-base .jpg" ,
33
+ "full" :"dev/tests/acceptance/tests/_data/adobe-base .jpg" ,
34
34
"caption" :"simple1" , "position" :"0" , "isMain" :false , "type" :"image" , "videoUrl" :null
35
35
}
36
36
] ,
@@ -49,34 +49,41 @@ define(['magnifier/magnify', 'mage/gallery/gallery', 'jquery'], function (Magnif
49
49
50
50
describe ( 'test magnifierFullscreen method' , function ( ) {
51
51
it ( 'Check if the current image has event handlers set for tap and double tap' , function ( ) {
52
+ let pageWrapperDiv = document . createElement ( 'div' ) ;
53
+ pageWrapperDiv . className = 'page-wrapper' ;
54
+
52
55
let productMediaDiv = document . createElement ( 'div' ) ;
53
56
productMediaDiv . className = 'product media' ;
54
57
55
58
let mainDiv = document . createElement ( 'div' ) ;
56
59
mainDiv . id = 'gallery_placeholder' ;
57
- mainDiv . className = 'gallery-placeholder' ;
60
+ mainDiv . className = 'gallery-placeholder _block-content-loading ' ;
58
61
mainDiv . setAttribute ( 'data-gallery-role' , 'gallery-placeholder' ) ;
59
62
60
63
let img = document . createElement ( 'img' ) ;
61
64
img . alt = 'main product photo' ;
62
65
img . id = 'main_product_photo' ;
63
66
img . className = 'gallery-placeholder__image' ;
64
- img . src = '/images/sample.jpg' ;
67
+ img . src = 'dev/tests/acceptance/tests/_data/adobe-base.jpg' ;
68
+
65
69
mainDiv . appendChild ( img ) ;
70
+ pageWrapperDiv . appendChild ( productMediaDiv ) ;
66
71
productMediaDiv . appendChild ( mainDiv ) ;
67
- document . body . appendChild ( productMediaDiv ) ;
72
+ document . body . appendChild ( pageWrapperDiv ) ;
68
73
69
74
magnify = new Magnify ( options , $ ( '#gallery_placeholder' ) ) ;
70
75
gallery = new Gallery ( options , $ ( '#gallery_placeholder' ) ) ;
71
- expect ( gallery . settings . fullscreenConfig ) . toBeDefined ( ) ;
72
- expect ( gallery . settings . fotoramaApi ) . toBeDefined ( ) ;
73
- expect ( gallery . settings . data ) . toBeDefined ( ) ;
74
- expect ( gallery . settings . api ) . toBeDefined ( ) ;
76
+
77
+ let activeImage = document . createElement ( 'img' ) ;
78
+ activeImage . className = 'fotorama__img--full' ;
79
+ $ ( '[data- gallery-role="stage-shaft"] [data-active="true"]' ) . append ( activeImage ) ;
75
80
76
81
gallery . openFullScreen ( ) ;
77
82
78
- console . log ( $ ( '.fotorama__img--full' ) ) ; //this should be available
79
- //console.log($._data($('.fotorama__img--full')[0], "events"));
83
+ let imageEvents = $ . _data ( $ ( '.fotorama__img--full' ) [ 0 ] , "events" ) ;
84
+
85
+ expect ( imageEvents ) . toBeInstanceOf ( Object ) ;
86
+ expect ( imageEvents . dblclick ) . toBeDefined ( ) ;
80
87
} ) ;
81
88
} ) ;
82
89
} ) ;
0 commit comments