-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathshowOnFocus.js
49 lines (40 loc) · 978 Bytes
/
showOnFocus.js
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
import {
$,
$input,
safeDispose,
fromData,
assertData,
assertText,
findPopper,
findToday,
assertNotFound,
assertVisible,
assertHidden,
assertDatesEqual,
findDayOfMonth,
prepare,
YYYY_MM_DD,
MM_DD_YYYY
} from '../../support'
import {Selector, ClassName} from '../../../js/constants'
import moment from 'moment'
describe('Datepicker', () => {
beforeEach(() => prepare())
afterEach(() => safeDispose())
describe('showOnFocus', () => {
it('default should show', () => {
$input.datepicker({})
let dp = assertData()
expect(dp.config.showOnFocus, `config.showOnFocus`).to.equal(true)
$input.focus()
assertVisible(Selector.POPPER)
})
it('false should remain hidden', () => {
$input.datepicker({showOnFocus: false})
let dp = assertData()
expect(dp.config.showOnFocus, `config.showOnFocus`).to.equal(false)
$input.focus()
assertNotFound(Selector.POPPER)
})
})
})