1
- describe ( 'Plugin Default Init ' , function ( ) {
1
+ describe ( 'SmartWizard Default Options ' , function ( ) {
2
2
var el , plugin ;
3
3
4
4
beforeEach ( function ( ) {
@@ -17,4 +17,48 @@ describe('Plugin Default Init', function() {
17
17
it ( 'should add default theme to the element' , function ( ) {
18
18
expect ( el ) . toHaveClass ( "sw-theme-default" ) ;
19
19
} ) ;
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
+
20
64
} ) ;
0 commit comments