import { getDeviceType, DEVICE_TYPE_MOBILE, DEVICE_TYPE_TABLET, DEVICE_TYPE_DESKTOP, } from 'utils/device' import { visibility } from '@adalo/constants' const { MOBILE_BREAKPOINT, TABLET_BREAKPOINT } = visibility describe('getDeviceType(deviceType)', () => { test('mobile', () => { const width = MOBILE_BREAKPOINT - 1 expect(getDeviceType(width)).toBe(DEVICE_TYPE_MOBILE) }) test('tablet', () => { const width = MOBILE_BREAKPOINT expect(getDeviceType(width)).toBe(DEVICE_TYPE_TABLET) }) test('tablet', () => { const width = TABLET_BREAKPOINT - 1 expect(getDeviceType(width)).toBe(DEVICE_TYPE_TABLET) }) test('desktop', () => { const width = TABLET_BREAKPOINT expect(getDeviceType(width)).toBe(DEVICE_TYPE_DESKTOP) }) })