base-tests.js 667 B

1234567891011121314151617181920212223242526272829
  1. module('Data adapters - Base');
  2. var BaseData = require('select2/data/base');
  3. var $ = require('jquery');
  4. var Options = require('select2/options');
  5. var options = new Options({});
  6. test('current is required', function (assert) {
  7. var data = new BaseData($('#qunit-fixture select'), options);
  8. assert.throws(
  9. function () {
  10. data.current(function () {});
  11. },
  12. 'current has no default implementation'
  13. );
  14. });
  15. test('query is required', function (assert) {
  16. var data = new BaseData($('#qunit-fixture select'), options);
  17. assert.throws(
  18. function () {
  19. data.query({}, function () {});
  20. },
  21. 'query has no default implementation'
  22. );
  23. });