summaryrefslogtreecommitdiff
path: root/packages/webapi/test/media.js
blob: e6e7b82d4103a36c2284512d1b45696d3db60e63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { expect } from 'chai'
import { polyfill } from '../mod.js'

describe('Media', () => {
	const target = {}

	before(() => polyfill(target))

	it('Includes MediaQueryList functionality', () => {
		expect(target).to.have.property('MediaQueryList')
		expect(target).to.have.property('matchMedia')
	})

	it('Supports matchMedia creation', () => {
		const mql = target.matchMedia('(min-width: 640px)')

		expect(mql.matches).to.equal(false)
		expect(mql.media).to.equal('(min-width: 640px)')
	})
})