mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-23 10:18:40 +00:00
And rewrite all the require calls. ```bash git mv src/utils/* packages/@uppy/utils/src sed -i 's/[./]*\/utils\//@uppy\/utils\/lib\//' src/**/*.js # transform (../)*utils → @uppy/utils ```
23 lines
668 B
JavaScript
23 lines
668 B
JavaScript
const isTouchDevice = require('./isTouchDevice')
|
|
|
|
describe('isTouchDevice', () => {
|
|
const RealTouchStart = global.window.ontouchstart
|
|
const RealMaxTouchPoints = global.navigator.maxTouchPoints
|
|
|
|
beforeEach(() => {
|
|
global.window.ontouchstart = true
|
|
global.navigator.maxTouchPoints = 1
|
|
})
|
|
|
|
afterEach(() => {
|
|
global.navigator.maxTouchPoints = RealMaxTouchPoints
|
|
global.window.ontouchstart = RealTouchStart
|
|
})
|
|
|
|
xit("should return true if it's a touch device", () => {
|
|
expect(isTouchDevice()).toEqual(true)
|
|
delete global.window.ontouchstart
|
|
global.navigator.maxTouchPoints = false
|
|
expect(isTouchDevice()).toEqual(false)
|
|
})
|
|
})
|