1 describe('Deck JS Menu', function() {
3 dsc
= defaults
.selectors
.container
;
5 beforeEach(function() {
6 loadFixtures('standard.html');
7 if (Modernizr
.history
) {
8 history
.replaceState({}, "", "#")
11 window
.location
.hash
= '#';
16 describe('showMenu()', function() {
17 it('should show the menu', function() {
18 expect($(dsc
)).not
.toHaveClass(defaults
.classes
.menu
);
20 expect($(dsc
)).toHaveClass(defaults
.classes
.menu
);
23 it('should do nothing if menu is already showing', function() {
24 if (Modernizr
.csstransforms
) {
28 expect($('.slide').attr('style')).toBeFalsy();
33 describe('hideMenu()', function() {
34 it('should hide the menu', function() {
37 expect($(dsc
)).not
.toHaveClass(defaults
.classes
.menu
);
41 describe('toggleMenu()', function() {
42 it('should toggle menu on and off', function() {
43 expect($(dsc
)).not
.toHaveClass(defaults
.classes
.menu
);
45 expect($(dsc
)).toHaveClass(defaults
.classes
.menu
);
47 expect($(dsc
)).not
.toHaveClass(defaults
.classes
.menu
);
51 describe('key bindings', function() {
54 beforeEach(function() {
55 e
= jQuery
.Event('keydown.deckmenu');
58 it('should toggle the menu if the specified key is pressed', function() {
61 expect($(dsc
)).toHaveClass(defaults
.classes
.menu
);
63 expect($(dsc
)).not
.toHaveClass(defaults
.classes
.menu
);