it('should not fire when `stepPrevious` is called on the first step', function () { var wizard = new Wizard({ steps: steps, activeIndex: 0 }); wizard.appendTo(container); var handler = jasmine.createSpy(); wizard.on('enter', handler); wizard.stepPrevious(); expect(handler).not.toHaveBeenCalled(); });
it('should do nothing when `stepPrevious` is called on the first step', function () { var wizard = new Wizard({ steps: steps, activeIndex: 0 }); wizard.stepPrevious(); expect(wizard.get('activeIndex')).toBe(0); });
it('should decrement `activeIndex` by 1 when `stepPrevious` is called', function () { var wizard = new Wizard({ steps: steps, activeIndex: 2 }); wizard.stepPrevious(); expect(wizard.get('activeIndex')).toBe(1); });