-
-
Notifications
You must be signed in to change notification settings - Fork 297
/
mediaQuery_test.ts
73 lines (71 loc) · 1.62 KB
/
mediaQuery_test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import { assert } from 'chai'
import mediaQuery from '../src/mediaQuery'
describe('mediaQuery', () => {
it('has types and features in [all]', () => {
assert.deepEqual(
Object.keys(mediaQuery.all),
Object.keys(mediaQuery.types).concat(Object.keys(mediaQuery.features))
)
})
it('has all media types', () => {
const types = [
'all',
'grid',
'aural',
'braille',
'handheld',
'print',
'projection',
'screen',
'tty',
'tv',
'embossed'
]
assert.deepEqual(Object.keys(mediaQuery.types), types)
})
it('has matchers', () => {
const matchers = [
'orientation',
'scan',
'aspectRatio',
'deviceAspectRatio',
'height',
'deviceHeight',
'width',
'deviceWidth',
'color',
'colorIndex',
'monochrome',
'resolution',
'type'
]
assert.deepEqual(Object.keys(mediaQuery.matchers), matchers)
})
it('has features', () => {
const features = [
'minAspectRatio',
'maxAspectRatio',
'minDeviceAspectRatio',
'maxDeviceAspectRatio',
'minHeight',
'maxHeight',
'minDeviceHeight',
'maxDeviceHeight',
'minWidth',
'maxWidth',
'minDeviceWidth',
'maxDeviceWidth',
'minColor',
'maxColor',
'minColorIndex',
'maxColorIndex',
'minMonochrome',
'maxMonochrome',
'minResolution',
'maxResolution'
]
const keys = features.concat(Object.keys(mediaQuery.matchers))
keys.splice(keys.indexOf('type'), 1)
assert.deepEqual(Object.keys(mediaQuery.features), keys)
})
})