Commit 936f463b authored by Kushal Pandya's avatar Kushal Pandya

Add tests for `gl.utils.isMetaClick`

parent 36431288
...@@ -73,5 +73,37 @@ require('~/lib/utils/common_utils'); ...@@ -73,5 +73,37 @@ require('~/lib/utils/common_utils');
expect(normalized[NGINX].nginx).toBe('ok'); 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);
});
});
}); });
})(); })();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment