4 'modules/documentCanvas/canvas/utils'
6 ], function($, chai, utils) {
9 /* jshint multistr:true */
10 /* global describe, it */
13 var expect = chai.expect;
16 describe('utils.nearestInDocumentOrder', function() {
20 ['return null if no match found',
27 ['returns nearest sibling if applicable',
38 ['looks inside siblings children',
59 tests.forEach(function(test) {
60 var description = test[0],
62 it(description, function() {
64 a = dom.find('#a').length ? dom.find('#a')[0] : null,
65 b = dom.find('#b')[0],
66 c = dom.find('#c').length ? dom.find('#c')[0] : null;
67 expect(utils.nearestInDocumentOrder('div', 'above', b)).to.equal(a, 'above');
68 expect(utils.nearestInDocumentOrder('div', 'below', b)).to.equal(c, 'below');