Sha256: 784cead85a727618b95f0aa28501b7c15e888cc3db6526761d8e172accc17949

Contents?: true

Size: 1.58 KB

Versions: 13

Compression:

Stored size: 1.58 KB

Contents

describe('Deck JS Status Indicator', function() {
	beforeEach(function() {
		loadFixtures('standard.html');
		if (Modernizr.history) {
			history.replaceState({}, "", "#")
		}
		else {
			window.location.hash = '#';
		}
		$.deck('.slide');
	});
	
	it('should start with scaling enabled', function() {
		expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
	});
	
	describe('disableScale()', function() {
		it('should remove the scale class from the container', function() {
			$.deck('disableScale');
			expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
		});
	});
	
	describe('enableScale()', function() {
		it('should add the scale class to the container', function() {
			$.deck('disableScale');
			$.deck('enableScale');
			expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
		});
	});
	
	describe('toggleScale()', function() {
		it('should toggle between adding and removing the scale class', function() {
			$.deck('toggleScale');
			expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
			$.deck('toggleScale');
			expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
		});
	});
	
	describe('key bindings', function() {
		var e,
		$d = $(document);

		beforeEach(function() {
			e = jQuery.Event('keydown.deckscale');
		});
		
		it('should toggle scaling if the specified key is pressed', function() {
			e.which = 83; // s
			$d.trigger(e);
			expect($.deck('getContainer')).not.toHaveClass(defaults.classes.scale);
			$d.trigger(e);
			expect($.deck('getContainer')).toHaveClass(defaults.classes.scale);
		});
	});
});

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
deckrb-0.5.2 public/deck.js/test/spec.scale.js
deckrb-0.5.1 public/deck.js/test/spec.scale.js
deckrb-0.5.0 public/deck.js/test/spec.scale.js
deckrb-0.4.2 public/deck.js/test/spec.scale.js
deckrb-0.4.1 public/deck.js/test/spec.scale.js
deckr-0.1.0 lib/deckr/templates/deck/test/spec.scale.js
deckrb-0.4.0 public/deck.js/test/spec.scale.js
deckrb-0.3.1 public/deck.js/test/spec.scale.js
deckrb-0.3.0 public/deck.js/test/spec.scale.js
deckrb-0.2.2 public/deck.js/test/spec.scale.js
deckrb-0.2.1 public/deck.js/test/spec.scale.js
deckrb-0.2.0 public/deck.js/test/spec.scale.js
deckrb-0.1.0 deck/test/spec.scale.js