1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00
django/js_tests/admin/DateTimeShortcuts.test.js
2015-09-02 13:52:38 -04:00

20 lines
574 B
JavaScript

/* global module, test, DateTimeShortcuts */
/* eslint global-strict: 0, strict: 0 */
'use strict';
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);
});