@@ -11,56 +11,58 @@ define(['magnifier/magnify', 'mage/gallery/gallery', 'jquery'], function (Magnif
1111 'use strict' ;
1212
1313 describe ( 'magnifier/magnify' , function ( ) {
14- var gallery , options , magnify ;
14+ var gallery , options ;
1515
1616 beforeEach ( function ( ) {
1717 options = {
1818 options : {
19- " nav" : " thumbs" , " loop" :true , " keyboard" :true , " arrows" :true , " allowfullscreen" :true ,
20- " showCaption" :false , " width" :700 , " thumbwidth" :88 , " thumbheight" :110 , " height" :700 ,
21- " transitionduration" :500 , " transition" : " slide" , " navarrows" :true , " navtype" : " slides" ,
22- " navdir" : " horizontal" , " whiteBorders" :1
19+ ' nav' : ' thumbs' , ' loop' :true , ' keyboard' :true , ' arrows' :true , ' allowfullscreen' :true ,
20+ ' showCaption' :false , ' width' :700 , ' thumbwidth' :88 , ' thumbheight' :110 , ' height' :700 ,
21+ ' transitionduration' :500 , ' transition' : ' slide' , ' navarrows' :true , ' navtype' : ' slides' ,
22+ ' navdir' : ' horizontal' , ' whiteBorders' :1
2323 } ,
2424 fullscreen : {
25- " nav" : " thumbs" , " loop" :true , " navdir" : " horizontal" , " navarrows" :false , " navtype" : " slides" ,
26- " arrows" :true , " showCaption" :false , " transitionduration" :500 , " transition" : " slide" , " whiteBorders" :1
25+ ' nav' : ' thumbs' , ' loop' :true , ' navdir' : ' horizontal' , ' navarrows' :false , ' navtype' : ' slides' ,
26+ ' arrows' :true , ' showCaption' :false , ' transitionduration' :500 , ' transition' : ' slide' , ' whiteBorders' :1
2727 } ,
28- breakpoints : { " mobile" : { " conditions" : { " max-width" : " 767px" } , " options" : { " options" : { " nav" : " dots" } } } } ,
28+ breakpoints : { ' mobile' : { ' conditions' : { ' max-width' : ' 767px' } , ' options' : { ' options' : { ' nav' : ' dots' } } } } ,
2929 data : [
3030 {
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- " caption" : " simple1" , " position" : "0" , " isMain" :false , " type" : " image" , " videoUrl" :null
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+ ' caption' : ' simple1' , ' position' : '0' , ' isMain' :false , ' type' : ' image' , ' videoUrl' :null
3535 }
36- ] ,
36+ ] ,
3737 magnifierOpts : {
38- " fullscreenzoom" : "20" ,
39- " top" : "" ,
40- " left" : "" ,
41- " width" : "" ,
42- " height" : "" ,
43- " eventType" : " hover" ,
44- " enabled" :false ,
45- " mode" : " outside"
38+ ' fullscreenzoom' : '20' ,
39+ ' top' : '' ,
40+ ' left' : '' ,
41+ ' width' : '' ,
42+ ' height' : '' ,
43+ ' eventType' : ' hover' ,
44+ ' enabled' :false ,
45+ ' mode' : ' outside'
4646 }
4747 } ;
4848 } ) ;
4949
5050 describe ( 'test magnifierFullscreen method' , function ( ) {
5151 it ( 'Check if the current image has event handlers set for tap and double tap' , function ( ) {
52- let pageWrapperDiv = document . createElement ( 'div' ) ;
52+ let pageWrapperDiv , productMediaDiv , mainDiv , img , activeImage , imageEvents ;
53+
54+ pageWrapperDiv = document . createElement ( 'div' ) ;
5355 pageWrapperDiv . className = 'page-wrapper' ;
5456
55- let productMediaDiv = document . createElement ( 'div' ) ;
57+ productMediaDiv = document . createElement ( 'div' ) ;
5658 productMediaDiv . className = 'product media' ;
5759
58- let mainDiv = document . createElement ( 'div' ) ;
60+ mainDiv = document . createElement ( 'div' ) ;
5961 mainDiv . id = 'gallery_placeholder' ;
6062 mainDiv . className = 'gallery-placeholder _block-content-loading' ;
6163 mainDiv . setAttribute ( 'data-gallery-role' , 'gallery-placeholder' ) ;
6264
63- let img = document . createElement ( 'img' ) ;
65+ img = document . createElement ( 'img' ) ;
6466 img . alt = 'main product photo' ;
6567 img . id = 'main_product_photo' ;
6668 img . className = 'gallery-placeholder__image' ;
@@ -71,17 +73,16 @@ define(['magnifier/magnify', 'mage/gallery/gallery', 'jquery'], function (Magnif
7173 productMediaDiv . appendChild ( mainDiv ) ;
7274 document . body . appendChild ( pageWrapperDiv ) ;
7375
74- magnify = new Magnify ( options , $ ( '#gallery_placeholder' ) ) ;
76+ new Magnify ( options , $ ( '#gallery_placeholder' ) ) ;
7577 gallery = new Gallery ( options , $ ( '#gallery_placeholder' ) ) ;
7678
77- let activeImage = document . createElement ( 'img' ) ;
79+ activeImage = document . createElement ( 'img' ) ;
7880 activeImage . className = 'fotorama__img--full' ;
7981 $ ( '[data-gallery-role="stage-shaft"] [data-active="true"]' ) . append ( activeImage ) ;
8082
8183 gallery . openFullScreen ( ) ;
8284
83- let imageEvents = $ . _data ( $ ( '.fotorama__img--full' ) [ 0 ] , "events" ) ;
84-
85+ imageEvents = $ . _data ( $ ( '.fotorama__img--full' ) [ 0 ] , 'events' ) ;
8586 expect ( imageEvents ) . toBeInstanceOf ( Object ) ;
8687 expect ( imageEvents . dblclick ) . toBeDefined ( ) ;
8788 } ) ;
0 commit comments