1 | import isMobile, { isMobileResult } from '../';
|
2 |
|
3 | describe('Desktop', () => {
|
4 | let mobile: isMobileResult;
|
5 | let userAgent: string;
|
6 |
|
7 | describe('Chrome', () => {
|
8 | beforeEach(() => {
|
9 | userAgent =
|
10 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.151 Safari/535.19';
|
11 | mobile = isMobile(userAgent);
|
12 | });
|
13 |
|
14 | test('should not be a mobile device', () => {
|
15 | expect(mobile.any).not.toBe(true);
|
16 | });
|
17 | });
|
18 |
|
19 | describe('Safari', () => {
|
20 | beforeEach(() => {
|
21 | userAgent =
|
22 | 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10';
|
23 | mobile = isMobile(userAgent);
|
24 | });
|
25 |
|
26 | test('should not be a mobile device', () => {
|
27 | expect(mobile.any).not.toBe(true);
|
28 | });
|
29 | });
|
30 | });
|