-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathenableOnReadonly.js
53 lines (46 loc) · 1.14 KB
/
enableOnReadonly.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
49
50
51
52
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()
$input.prop('readonly', 'readonly')
$input.val('03/05/2012')
})
afterEach(() => safeDispose())
describe('enableOnReadonly', () => {
it('default true should show popper', () => {
$input.datepicker()
let dp = assertData()
expect(dp.config.enableOnReadonly, `config.enableOnReadonly`).to.equal(true)
assertNotFound(Selector.POPPER)
dp.show()
assertVisible(Selector.POPPER)
})
it('false should not show popper', () => {
$input.datepicker({enableOnReadonly: false})
let dp = assertData()
expect(dp.config.enableOnReadonly, `config.enableOnReadonly`).to.equal(false)
assertNotFound(Selector.POPPER)
dp.show()
assertNotFound(Selector.POPPER)
})
})
})