afterEach(function() {
plugin.destroy();
+ document.activeElement.blur();
$html.remove();
});
$html.find('.accordion-content').eq(0).should.have.attr('aria-hidden', 'false');
});
});
-
+
describe('keyboard events', function() {
it('opens next panel on ARROW_DOWN', function() {
$html = $(template).appendTo('body');
$html.find('.accordion-content').eq(1).should.have.attr('aria-hidden', 'false');
});
});
-});
\ No newline at end of file
+});
afterEach(function() {
plugin.destroy();
+ document.activeElement.blur();
$html.remove();
});
// Open one first
plugin._show($html.find('li.is-drilldown-submenu-parent').eq(2));
-
+
$html.one('closed.zf.drilldown', function() {
$html.find('ul[data-submenu].is-active').each(function() {
// Checking with .be.hidden is not possible because they don't have display: block but z-index: -1
$html.find('> li:nth-child(1) > a').focus()
.trigger(window.mockKeyboardEvent('ARROW_RIGHT'));
-
+
setTimeout(function() { // Timeout to make sure transition has ended
$html.find('> li:nth-child(1) > ul > li[data-is-parent-link] a')[0].should.be.equal(document.activeElement);
done();
$html.find('> li:nth-child(1) > ul').should.have.class('is-closing');
});
});
-});
\ No newline at end of file
+});
afterEach(function() {
plugin.destroy();
+ document.activeElement.blur();
$dropdownController.remove();
$dropdownContainer.remove();
});
afterEach(function () {
plugin.destroy();
+ document.activeElement.blur();
$html.remove();
});
afterEach(function() {
plugin.destroy();
+ document.activeElement.blur();
$html.remove();
});
plugin.toggle();
});
});
-
+
describe('keyboard events', function() {
it('closes Off Canvas on ESCAPE', function(done) {
$html = $(template).appendTo('body');
afterEach(function() {
plugin.destroy();
+ document.activeElement.blur();
$html.remove();
});
'ARROW_DOWN': 40
};
+ afterEach(function() {
+ document.activeElement.blur();
+ });
+
it('exists on the Foundation API', function() {
(window.Foundation.Keyboard).should.be.an('object');
});