Skip to content
Snippets Groups Projects
Commit 936f463b authored by Kushal Pandya's avatar Kushal Pandya
Browse files

Add tests for `gl.utils.isMetaClick`

parent 36431288
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -73,5 +73,37 @@ require('~/lib/utils/common_utils');
expect(normalized[NGINX].nginx).toBe('ok');
});
});
describe('gl.utils.isMetaClick', () => {
it('should identify meta click on Windows/Linux', () => {
const e = {
metaKey: false,
ctrlKey: true,
which: 1,
};
expect(gl.utils.isMetaClick(e)).toBe(true);
});
it('should identify meta click on macOS', () => {
const e = {
metaKey: true,
ctrlKey: false,
which: 1,
};
expect(gl.utils.isMetaClick(e)).toBe(true);
});
it('should identify as meta click on middle-click or Mouse-wheel click', () => {
const e = {
metaKey: false,
ctrlKey: false,
which: 2,
};
expect(gl.utils.isMetaClick(e)).toBe(true);
});
});
});
})();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment