Skip to content

Commit e2e9744

Browse files
committed
ACP2E-3029: [Cloud] Mobile Issue Only not able to pinch on the PDP image
1 parent 0f8b664 commit e2e9744

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

dev/tests/js/jasmine/tests/lib/web/magnify.test.js

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ define(['magnifier/magnify', 'mage/gallery/gallery', 'jquery'], function (Magnif
2828
breakpoints: {"mobile":{"conditions":{"max-width":"767px"},"options":{"options":{"nav":"dots"}}}},
2929
data: [
3030
{
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",
3434
"caption":"simple1","position":"0","isMain":false,"type":"image","videoUrl":null
3535
}
3636
],
@@ -49,34 +49,41 @@ define(['magnifier/magnify', 'mage/gallery/gallery', 'jquery'], function (Magnif
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');
53+
pageWrapperDiv.className = 'page-wrapper';
54+
5255
let productMediaDiv = document.createElement('div');
5356
productMediaDiv.className = 'product media';
5457

5558
let mainDiv = document.createElement('div');
5659
mainDiv.id = 'gallery_placeholder';
57-
mainDiv.className = 'gallery-placeholder';
60+
mainDiv.className = 'gallery-placeholder _block-content-loading';
5861
mainDiv.setAttribute('data-gallery-role', 'gallery-placeholder');
5962

6063
let img = document.createElement('img');
6164
img.alt = 'main product photo';
6265
img.id = 'main_product_photo';
6366
img.className = 'gallery-placeholder__image';
64-
img.src = '/images/sample.jpg';
67+
img.src = 'dev/tests/acceptance/tests/_data/adobe-base.jpg';
68+
6569
mainDiv.appendChild(img);
70+
pageWrapperDiv.appendChild(productMediaDiv);
6671
productMediaDiv.appendChild(mainDiv);
67-
document.body.appendChild(productMediaDiv);
72+
document.body.appendChild(pageWrapperDiv);
6873

6974
magnify = new Magnify(options, $('#gallery_placeholder'));
7075
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);
7580

7681
gallery.openFullScreen();
7782

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();
8087
});
8188
});
8289
});

0 commit comments

Comments
 (0)