@@ -63,23 +63,6 @@ describe('swiper should have the following properties', function(){
6363 }
6464} ) ;
6565
66- describe ( 'it should add classes to dom' , function ( ) {
67- var $slider = swiper . $items [ swiper . _current ] ;
68- var $items = $slider . querySelectorAll ( '*[toggle-class]' ) ;
69- Array . prototype . forEach . call ( $items , function ( $item , index ) {
70- var clazz = $item . getAttribute ( 'toggle-class' ) . split ( / \s + / ) ;
71- for ( var i = 0 , len = clazz . length ; i < len ; i ++ ) {
72- ( function ( i ) {
73- it ( '.' + clazz , function ( done ) {
74- setTimeout ( function ( ) {
75- assert ( $item . className . indexOf ( clazz [ i ] ) !== - 1 ) ;
76- done ( ) ;
77- } , 1000 ) ;
78- } ) ;
79- } ) ( i ) ;
80- }
81- } ) ;
82- } ) ;
8366
8467describe ( '.next()' , function ( ) {
8568 it ( 'should translateY the container to the slide height & should add classes to dom' , function ( ) {
@@ -96,6 +79,20 @@ describe('.next()', function (){
9679 } ) ;
9780} ) ;
9881
82+ describe ( '.go()' , function ( ) {
83+ it ( 'should translateY the container to the slide height & should add classes to dom' , function ( ) {
84+ swiper . go ( 0 ) ;
85+ for ( var i = 1 , len = swiper . $items . length ; i < len ; i ++ ) {
86+ swiper . go ( i ) ;
87+ var height = swiper . $items [ i ] . style [ 'height' ] . replace ( 'px' , '' ) ;
88+ var expect = 'translate3d(0px, -' + ( height * i ) + 'px, 0px)' ;
89+
90+ assert ( swiper . _current === i ) ;
91+ assert ( swiper . $container . style [ '-webkit-transform' ] === expect ) ;
92+ }
93+ } ) ;
94+ } ) ;
95+
9996describe ( '.on()' , function ( ) {
10097 it ( 'swiped listener should not be empty' , function ( ) {
10198
0 commit comments