Skip to content

Commit

Permalink
chore: PhantomJS clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jarekdanielak committed Oct 31, 2024
1 parent 1e1b70e commit 912b0b9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 19 deletions.
8 changes: 3 additions & 5 deletions lib/features/preview-support/PreviewSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,10 @@ PreviewSupport.prototype._cloneMarkers = function(gfx, className = 'djs-dragger'

if (gfx.childNodes) {

// TODO: use forEach once we drop PhantomJS
for (var i = 0; i < gfx.childNodes.length; i++) {
gfx.childNodes.forEach((childNode) => {
self._cloneMarkers(childNode, className, rootGfx);
});

// recursively clone markers of child nodes
self._cloneMarkers(gfx.childNodes[ i ], className, rootGfx);
}
}

if (!canHaveMarker(gfx)) {
Expand Down
6 changes: 1 addition & 5 deletions test/spec/core/CanvasSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('Canvas', function() {
}));


(isPhantomJS() ? it.skip : it)('should not scroll on focus', inject(function(canvas, eventBus) {
it('should not scroll on focus', inject(function(canvas, eventBus) {

// given
var svg = container.querySelector('svg');
Expand Down Expand Up @@ -2750,7 +2750,3 @@ function expectChildren(parent, children) {

}


function isPhantomJS() {
return /PhantomJS/.test(window.navigator.userAgent);
}
Original file line number Diff line number Diff line change
Expand Up @@ -295,9 +295,7 @@ describe('features/interaction-events', function() {
describe('api', function() {

function getHits(gfx) {

// TODO(nikku): remove filter when we drop PhantomJS
return filter(domQueryAll('.djs-hit', gfx), function(hit) { return typeof hit !== 'number'; });
return domQueryAll('.djs-hit', gfx);
}


Expand Down
8 changes: 2 additions & 6 deletions test/spec/features/palette/PaletteSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ describe('features/palette', function() {
}));


(isPhantomJS() ? it.skip : it)('should update tool highlight', inject(function(eventBus, palette) {
it('should update tool highlight', inject(function(eventBus, palette) {

// given
var toolName = 'entryA';
Expand All @@ -629,7 +629,7 @@ describe('features/palette', function() {
}));


(isPhantomJS() ? it.skip : it)('should unset tool highlight', inject(function(eventBus, palette) {
it('should unset tool highlight', inject(function(eventBus, palette) {

// given
var toolName = 'entryA';
Expand Down Expand Up @@ -876,7 +876,3 @@ function expectContainerCls(marker, expectedActive) {
function getEntryNode(action, container) {
return domQuery('.entry[data-action="' + action + '"]', container);
}

function isPhantomJS() {
return /PhantomJS/.test(window.navigator.userAgent);
}

0 comments on commit 912b0b9

Please sign in to comment.