defaults.js 967 B

12345678910111213141516171819
  1. 'use strict';
  2. var test = require('tape');
  3. var dragula = require('..');
  4. test('drake has sensible default options', function (t) {
  5. var options = {};
  6. dragula(options);
  7. t.equal(typeof options.moves, 'function', 'options.moves defaults to a method');
  8. t.equal(typeof options.accepts, 'function', 'options.accepts defaults to a method');
  9. t.equal(typeof options.invalid, 'function', 'options.invalid defaults to a method');
  10. t.equal(typeof options.isContainer, 'function', 'options.isContainer defaults to a method');
  11. t.equal(options.copy, false, 'options.copy defaults to false');
  12. t.equal(options.revertOnSpill, false, 'options.revertOnSpill defaults to false');
  13. t.equal(options.removeOnSpill, false, 'options.removeOnSpill defaults to false');
  14. t.equal(options.direction, 'vertical', 'options.direction defaults to \'vertical\'');
  15. t.equal(options.mirrorContainer, document.body, 'options.mirrorContainer defaults to an document.body');
  16. t.end();
  17. });