Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test for keyboard zoom on a Mac #14977

Merged
merged 1 commit into from Aug 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions test/browser/spec/ol/interaction/keyboardzoom.test.js
Expand Up @@ -2,6 +2,7 @@ import Event from '../../../../../src/ol/events/Event.js';
import Map from '../../../../../src/ol/Map.js';
import MapBrowserEvent from '../../../../../src/ol/MapBrowserEvent.js';
import View from '../../../../../src/ol/View.js';
import {MAC} from '../../../../../src/ol/has.js';

describe('ol.interaction.KeyboardZoom', function () {
let map;
Expand Down Expand Up @@ -58,7 +59,7 @@ describe('ol.interaction.KeyboardZoom', function () {
expect(spy.called).to.be(false);
});

it('does nothing if ctrl key is pressed at the same time', function () {
it('does nothing if platform modifier key is pressed at the same time', function () {
const view = map.getView();
const spy = sinon.spy(view, 'animateInternal');
const event = new MapBrowserEvent('keydown', map, {
Expand All @@ -68,7 +69,11 @@ describe('ol.interaction.KeyboardZoom', function () {
});

event.originalEvent.key = '+';
event.originalEvent.ctrlKey = true;
if (MAC) {
event.originalEvent.metaKey = true;
} else {
event.originalEvent.ctrlKey = true;
}
map.handleMapBrowserEvent(event);
expect(spy.called).to.be(false);
});
Expand Down