Repository URL to install this package:
|
Version:
8.0.0 ▾
|
import isTouch from './isTouch';
describe('isTouch', () => {
it('should show touch if ontouchstart exists', () => {
global.ontouchstart = true;
expect(isTouch()).toEqual(true);
});
it("should not show touch if ontouchstart doesn't exist", () => {
delete global.ontouchstart;
expect(isTouch()).toEqual(false);
});
it('should show touch if maxTouchPoints exists', () => {
global.navigator.maxTouchPoints = true;
expect(isTouch()).toEqual(true);
});
it("should not show touch if maxTouchPoints doesn't exist", () => {
delete global.navigator.maxTouchPoints;
expect(isTouch()).toEqual(false);
});
});