| 1 | <!DOCTYPE html> |
| 2 | <html> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-type" content="text/html; charset=utf-8"> |
| 5 | <title>_TimePicker DOH Test</title> |
| 6 | |
| 7 | <script type="text/javascript" src="boilerplate.js"></script> |
| 8 | |
| 9 | <script type="text/javascript"> |
| 10 | require([ |
| 11 | "doh/runner", |
| 12 | "dojo/_base/declare", |
| 13 | "dijit/_TimePicker", |
| 14 | "dojo/domReady!" |
| 15 | ], function(doh, declare, _TimePicker){ |
| 16 | |
| 17 | doh.register("tests", [ |
| 18 | function extended_range(){ |
| 19 | var t1 = _TimePicker({}, "t1"); |
| 20 | t1.set('value', new Date("December 11, 2011 00:09:30")); |
| 21 | doh.is(96, t1.timeMenu.children.length, 'num entries 1'); |
| 22 | }, |
| 23 | function constraints17250(){ |
| 24 | var tp = new (declare(_TimePicker, { |
| 25 | isDisabledDate: function () { |
| 26 | return this.inherited(arguments); |
| 27 | } |
| 28 | }))(); |
| 29 | |
| 30 | tp.set('constraints', { |
| 31 | constructor: null, |
| 32 | clickableIncrement: 'T01:00:00', |
| 33 | set: function () { |
| 34 | throw new Error('Wrong set called'); |
| 35 | } |
| 36 | }); |
| 37 | |
| 38 | tp.set('value', new Date()); |
| 39 | doh.is(24, tp.timeMenu.children.length, 'Increment constraints should be copied but other non-constraint properties should not'); |
| 40 | }, |
| 41 | function min_max(){ |
| 42 | var tp = _TimePicker({ |
| 43 | pickerMin: "T09:00:00", |
| 44 | clickableIncrement: "T01:00:00", |
| 45 | pickerMax: "T17:00:00" |
| 46 | }); |
| 47 | doh.is(9, tp.timeMenu.children.length, 'num entries'); |
| 48 | } |
| 49 | ]); |
| 50 | |
| 51 | doh.run(); |
| 52 | }); |
| 53 | </script> |
| 54 | |
| 55 | </head> |
| 56 | <body> |
| 57 | <h1 class="testTitle">dijit._TimePicker automated tests (non-robot)</h1> |
| 58 | |
| 59 | <label for="t1">t1:</label> |
| 60 | <div id="t1" style="height: 200px; width: 150px; overflow: auto;"></div> |
| 61 | </body> |
| 62 | </html> |