SelectFilter2.test.js 762 B

123456789101112131415161718
  1. /* global module, test, SelectFilter */
  2. /* eslint global-strict: 0, strict: 0 */
  3. 'use strict';
  4. module('admin.SelectFilter2');
  5. test('init', function(assert) {
  6. var $ = django.jQuery;
  7. $('<form><select id="id"></select></form>').appendTo('#qunit-fixture');
  8. $('<option value="0">A</option>').appendTo('#id');
  9. SelectFilter.init('id', 'things', 0);
  10. assert.equal($('.selector-available h2').text().trim(), "Available things");
  11. assert.equal($('.selector-chosen h2').text().trim(), "Chosen things");
  12. assert.equal($('.selector-chooseall').text(), "Choose all");
  13. assert.equal($('.selector-add').text(), "Choose");
  14. assert.equal($('.selector-remove').text(), "Remove");
  15. assert.equal($('.selector-clearall').text(), "Remove all");
  16. });