diff options
| author | Anton Samarchyan <anton.samarchyan@savoirfairelinux.com> | 2017-01-05 17:21:40 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-05-27 10:50:18 -0400 |
| commit | 385cf7091e066604f9e417c6ef63685492a08d13 (patch) | |
| tree | e1f2d74a1792856cf9f576b289911c1af53e9090 /js_tests | |
| parent | 5b6181f4d58f63e7d2b52ab94e162e5ce8980f12 (diff) | |
Fixed #25006 -- Allowed custom time shortcuts in admin's time picker.
Diffstat (limited to 'js_tests')
| -rw-r--r-- | js_tests/admin/DateTimeShortcuts.test.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/js_tests/admin/DateTimeShortcuts.test.js b/js_tests/admin/DateTimeShortcuts.test.js index 5d5b12ba60..4e534954f3 100644 --- a/js_tests/admin/DateTimeShortcuts.test.js +++ b/js_tests/admin/DateTimeShortcuts.test.js @@ -21,3 +21,12 @@ QUnit.test('init', function(assert) { // should be 0 when a timezone offset isn't set in the HTML body attribute. assert.equal(DateTimeShortcuts.timezoneOffset, 0); }); + +QUnit.test('custom time shortcuts', function(assert) { + var $ = django.jQuery; + var timeField = $('<input type="text" name="time_test" class="vTimeField">'); + $('#qunit-fixture').append(timeField); + DateTimeShortcuts.clockHours.time_test = [['3 a.m.', 3]]; + DateTimeShortcuts.init(); + assert.equal($('.clockbox').find('a').first().text(), '3 a.m.'); +}); |
