1
0
mirror of synced 2024-12-02 09:36:01 +03:00
select2/tests/data/base-tests.js
Kevin Brown 114732ec25 Broke out a base data adapter
This should allow us to create a basic interface that all adapters
must follow.
2014-10-21 21:43:57 -04:00

30 lines
665 B
JavaScript

module("Data adapters - Base")
var BaseData = require("select2/data/base");
var $ = require("jquery");
var Options = require("select2/options");
var options = new Options({});
test("current is required", function (assert) {
var data = new BaseData($("#qunit-fixture select"), options);
assert.throws(
function () {
data.current(function () {});
},
"current has no default implementation"
)
});
test("query is required", function (assert) {
var data = new BaseData($("#qunit-fixture select"), options);
assert.throws(
function () {
data.query({}, function () {});
},
"query has no default implementation"
);
});