Sha256: 701144d307dcd09703364124d2f500622a2186e516e74a8967430dc0c983bdb1

Contents?: true

Size: 1.59 KB

Versions: 13

Compression:

Stored size: 1.59 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 show the correct total number of slides', function() {
		expect($(defaults.selectors.statusTotal)).toHaveText($.deck('getSlides').length);
	});
	
	it('should start at the right current slide', function() {
		expect($(defaults.selectors.statusCurrent)).toHaveText(1);
		$.deck('go', 2);
		$.deck('.slide');
		expect($(defaults.selectors.statusCurrent)).toHaveText(3);
	});
	
	it('should update to the correct number on slide change', function() {
		$.deck('go', 2);
		expect($(defaults.selectors.statusCurrent)).toHaveText('3');
	});
});

describe('countNested false indicator', function() {
	beforeEach(function() {
		loadFixtures('nesteds.html');
		if (Modernizr.history) {
			history.replaceState({}, "", "#")
		}
		else {
			window.location.hash = '#';
		}
		$.deck('.slide', {
			countNested: false
		});
	});
	
	it('should ignore nested slides in the total', function() {
		expect($(defaults.selectors.statusTotal)).toHaveText('5');
	});
	
	it('should update to the root slide number when nested becomes active', function() {
		$.deck('go', 10);
		expect($(defaults.selectors.statusCurrent)).toHaveText('4');
		$.deck('prev');
		expect($(defaults.selectors.statusCurrent)).toHaveText('3');
		$.deck('go', 3);
		expect($(defaults.selectors.statusCurrent)).toHaveText('3');
		$.deck('go', 1);
		expect($(defaults.selectors.statusCurrent)).toHaveText('2');
	});
});

Version data entries

13 entries across 13 versions & 2 rubygems

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