diff --git a/test/spec/behavior/hover.js b/test/spec/behavior/hover.js index 75f506d27..6cf743dbe 100644 --- a/test/spec/behavior/hover.js +++ b/test/spec/behavior/hover.js @@ -41,13 +41,13 @@ describe('iD.behaviorHover', function() { .enter().append('span').attr('class', function(d) { return d.id; }); _container.call(iD.behaviorHover(_context)); - iD.utilTriggerEvent(_container.selectAll('.a'), 'mouseover'); + iD.utilTriggerEvent(_container.select('.a'), 'mouseover'); - expect(_container.selectAll('.a.hover').nodes()).to.have.length(2); - expect(_container.selectAll('.b.hover').nodes()).to.have.length(0); + expect(_container.selectAll('.a.hover').size()).to.eql(2); + expect(_container.selectAll('.b.hover').size()).to.eql(0); - iD.utilTriggerEvent(_container.selectAll('.a'), 'mouseout'); - expect(_container.selectAll('.hover').nodes()).to.have.length(0); + iD.utilTriggerEvent(_container.select('.a'), 'mouseout'); + expect(_container.selectAll('.hover').size()).to.eql(0); }); it('adds the .hover class to all members of a relation', function() { @@ -62,11 +62,11 @@ describe('iD.behaviorHover', function() { _container.call(iD.behaviorHover(_context)); iD.utilTriggerEvent(_container.selectAll('.a'), 'mouseover'); - expect(_container.selectAll('.a.hover').nodes()).to.have.length(1); - expect(_container.selectAll('.b.hover').nodes()).to.have.length(1); + expect(_container.selectAll('.a.hover').size()).to.eql(1); + expect(_container.selectAll('.b.hover').size()).to.eql(1); iD.utilTriggerEvent(_container.selectAll('.a'), 'mouseout'); - expect(_container.selectAll('.hover').nodes()).to.have.length(0); + expect(_container.selectAll('.hover').size()).to.eql(0); }); }); @@ -76,8 +76,8 @@ describe('iD.behaviorHover', function() { _container.call(iD.behaviorHover(_context).altDisables(true)); happen.keydown(window, { keyCode: 18 }); - expect(_container.selectAll('.hover').nodes()).to.have.length(0); - expect(_container.selectAll('.hover-suppressed').nodes()).to.have.length(1); + expect(_container.selectAll('.hover').size()).to.eql(0); + expect(_container.selectAll('.hover-suppressed').size()).to.eql(1); happen.keyup(window, { keyCode: 18 }); }); @@ -97,8 +97,8 @@ describe('iD.behaviorHover', function() { happen.keydown(window, { keyCode: 18 }); happen.keyup(window, { keyCode: 18 }); - expect(_container.selectAll('.hover').nodes()).to.have.length(1); - expect(_container.selectAll('.hover-suppressed').nodes()).to.have.length(0); + expect(_container.selectAll('.hover').size()).to.eql(1); + expect(_container.selectAll('.hover-suppressed').size()).to.eql(0); }); it('removes the .hover-disabled class from the surface', function () {