File tree 2 files changed +48
-0
lines changed
2 files changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ < div class ="row ">
2
+ < div class ="input-field col s12 ">
3
+ <!-- Datepicker -->
4
+ < input type ="text " class ="datepicker " id ="datepickerInput ">
5
+ </ div >
6
+ </ div >
Original file line number Diff line number Diff line change
1
+ describe ( 'Datepicker Plugin' , function ( ) {
2
+ beforeEach ( async function ( ) {
3
+ await XloadFixtures ( [ 'datepicker/datepickerFixture.html' ] ) ;
4
+ M . Datepicker . init ( document . querySelectorAll ( '.datepicker' ) ) ;
5
+ } ) ;
6
+ afterEach ( function ( ) {
7
+ XunloadFixtures ( ) ;
8
+ } ) ;
9
+
10
+ describe ( 'Datepicker' , function ( ) {
11
+ var normalDropdown ;
12
+
13
+ beforeEach ( function ( ) {
14
+ // browserSelect = $('select.normal');
15
+ } ) ;
16
+
17
+ it ( 'should open and close programmatically' , function ( done ) {
18
+ let input = document . querySelector ( '#datepickerInput' ) ;
19
+ let modal = document . querySelector ( '.datepicker-modal' ) ;
20
+
21
+ expect ( modal ) . toBeHidden ( 'Should be hidden before datepicker input is focused.' ) ;
22
+
23
+ M . Datepicker . getInstance ( input ) . open ( ) ;
24
+
25
+ setTimeout ( function ( ) {
26
+ expect ( modal ) . toHaveClass (
27
+ 'open' ,
28
+ 'Datepicker modal should be shown after datepicker input is focused.'
29
+ ) ;
30
+ M . Datepicker . getInstance ( input ) . close ( ) ;
31
+
32
+ setTimeout ( function ( ) {
33
+ expect ( modal ) . toNotHaveClass (
34
+ 'open' ,
35
+ 'Datepicker modal should be hidden after datepicker input is focused.'
36
+ ) ;
37
+ done ( ) ;
38
+ } , 400 ) ;
39
+ } , 400 ) ;
40
+ } ) ;
41
+ } ) ;
42
+ } ) ;
You can’t perform that action at this time.
0 commit comments