3 'modules/documentCanvas/canvas/utils'
5 ], function(chai, utils) {
9 var expect = chai.expect;
12 describe('utils.nearestInDocumentOrder', function() {
16 ['return null if no match found',
23 ['returns nearest sibling if applicable',
34 ['looks inside siblings children',
55 tests.forEach(function(test) {
56 var description = test[0],
58 it(description, function() {
60 a = dom.find('#a').length ? dom.find('#a')[0] : null,
61 b = dom.find('#b')[0],
62 c = dom.find('#c').length ? dom.find('#c')[0] : null;
63 expect(utils.nearestInDocumentOrder('div', 'above', b)).to.equal(a, 'above');
64 expect(utils.nearestInDocumentOrder('div', 'below', b)).to.equal(c, 'below');