Skip to content

Commit fa2e920

Browse files
author
Dipu Raj
committed
More test cases added
1 parent 05f4973 commit fa2e920

File tree

1 file changed

+45
-1
lines changed

1 file changed

+45
-1
lines changed

test/test.js

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
describe('Plugin Default Init', function() {
1+
describe('SmartWizard Default Options', function() {
22
var el, plugin;
33

44
beforeEach(function(){
@@ -17,4 +17,48 @@ describe('Plugin Default Init', function() {
1717
it('should add default theme to the element', function() {
1818
expect(el).toHaveClass("sw-theme-default");
1919
});
20+
21+
it('should add toolbar elements', function() {
22+
expect(el.children('.sw-toolbar')).toExist();
23+
expect(el.children('.sw-toolbar').children('.sw-btn-group').children('.sw-btn-next')).toExist();
24+
expect(el.children('.sw-toolbar').children('.sw-btn-group').children('.sw-btn-prev')).toExist();
25+
});
26+
27+
it('should have step anchors', function() {
28+
expect(el.children('ul').children('li').children('a')).toExist();
29+
});
30+
31+
it('should have step contents', function() {
32+
expect(el.children('div').children('div')).toExist();
33+
});
34+
35+
it('should have step anchors step contents are equal numbers', function() {
36+
var a = el.children('ul').children('li').children('a');
37+
var c = el.children('div').children('div');
38+
expect(a.length).toBe(c.length);
39+
});
40+
41+
});
42+
43+
describe('SmartWizard Navigation', function() {
44+
var el, plugin;
45+
46+
beforeEach(function(){
47+
jasmine.getFixtures().fixturesPath = 'base/test';
48+
loadFixtures('test-template.html');
49+
50+
el = $('#smartwizard');
51+
plugin = el.smartWizard();
52+
});
53+
54+
afterEach(function(){
55+
el.remove();
56+
el = null;
57+
});
58+
59+
it('should point to the first step', function() {
60+
expect(el.children('ul').children('li:first')).toHaveClass("active");
61+
expect(el.children('ul').children('li :not(:first)')).not.toHaveClass("active");
62+
});
63+
2064
});

0 commit comments

Comments
 (0)