forked from bevacqua/dragula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrake-api.js
27 lines (24 loc) · 1.04 KB
/
drake-api.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
'use strict';
var test = require('tape');
var dragula = require('..');
test('drake can be instantiated without throwing', function (t) {
t.doesNotThrow(drakeFactory, 'calling dragula() without arguments does not throw');
t.end();
function drakeFactory () {
return dragula();
}
});
test('drake has expected api properties', function (t) {
var drake = dragula();
t.ok(drake, 'drake is not null');
t.equal(typeof drake, 'object', 'drake is an object');
t.ok(Array.isArray(drake.containers), 'drake.containers is an array');
t.equal(typeof drake.start, 'function', 'drake.start is a method');
t.equal(typeof drake.end, 'function', 'drake.end is a method');
t.equal(typeof drake.cancel, 'function', 'drake.cancel is a method');
t.equal(typeof drake.remove, 'function', 'drake.remove is a method');
t.equal(typeof drake.destroy, 'function', 'drake.destroy is a method');
t.equal(typeof drake.dragging, 'boolean', 'drake.dragging is a boolean');
t.equal(drake.dragging, false, 'drake.dragging is initialized as false');
t.end();
});