mirror of
https://github.com/django/django.git
synced 2024-11-18 07:26:04 +00:00
2d0dead224
Setup QUnit, added tests, and measured test coverage. Thanks to Nick Sanford for the initial tests.
16 lines
473 B
JavaScript
16 lines
473 B
JavaScript
module('admin.DateTimeShortcuts');
|
|
|
|
test('init', function(assert) {
|
|
var $ = django.jQuery;
|
|
|
|
var dateField = $('<input type="text" class="vDateField" value="2015-03-16"><br>');
|
|
$('#qunit-fixture').append(dateField);
|
|
|
|
DateTimeShortcuts.init();
|
|
|
|
var shortcuts = $('.datetimeshortcuts');
|
|
assert.equal(shortcuts.length, 1);
|
|
assert.equal(shortcuts.find('a:first').text(), 'Today');
|
|
assert.equal(shortcuts.find('a:last .date-icon').length, 1);
|
|
});
|