Skip to content

Commit

Permalink
More test cases added
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipu Raj committed Apr 21, 2017
1 parent 05f4973 commit fa2e920
Showing 1 changed file with 45 additions and 1 deletion.
46 changes: 45 additions & 1 deletion test/test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
describe('Plugin Default Init', function() {
describe('SmartWizard Default Options', function() {
var el, plugin;

beforeEach(function(){
Expand All @@ -17,4 +17,48 @@ describe('Plugin Default Init', function() {
it('should add default theme to the element', function() {
expect(el).toHaveClass("sw-theme-default");
});

it('should add toolbar elements', function() {
expect(el.children('.sw-toolbar')).toExist();
expect(el.children('.sw-toolbar').children('.sw-btn-group').children('.sw-btn-next')).toExist();
expect(el.children('.sw-toolbar').children('.sw-btn-group').children('.sw-btn-prev')).toExist();
});

it('should have step anchors', function() {
expect(el.children('ul').children('li').children('a')).toExist();
});

it('should have step contents', function() {
expect(el.children('div').children('div')).toExist();
});

it('should have step anchors step contents are equal numbers', function() {
var a = el.children('ul').children('li').children('a');
var c = el.children('div').children('div');
expect(a.length).toBe(c.length);
});

});

describe('SmartWizard Navigation', function() {
var el, plugin;

beforeEach(function(){
jasmine.getFixtures().fixturesPath = 'base/test';
loadFixtures('test-template.html');

el = $('#smartwizard');
plugin = el.smartWizard();
});

afterEach(function(){
el.remove();
el = null;
});

it('should point to the first step', function() {
expect(el.children('ul').children('li:first')).toHaveClass("active");
expect(el.children('ul').children('li :not(:first)')).not.toHaveClass("active");
});

});

0 comments on commit fa2e920

Please sign in to comment.