This repository was archived by the owner on Apr 15, 2020. It is now read-only.
File tree 1 file changed +46
-0
lines changed
1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ describe ( 'Service: wheel' , function ( ) {
4
+ var element ;
5
+
6
+ beforeEach ( module ( 'snapscroll' ) ) ;
7
+
8
+ beforeEach ( function ( ) {
9
+ var html = [
10
+ '<div style="height: 100px; overflow: auto">' ,
11
+ '<div style="height: 1000px"></div>' ,
12
+ '</div>'
13
+ ] . join ( '' ) ;
14
+ element = angular . element ( html ) ;
15
+ angular . element ( document ) . find ( 'body' ) . append ( element ) ;
16
+ } ) ;
17
+
18
+ afterEach ( function ( ) {
19
+ angular . element ( document ) . find ( 'body' ) . empty ( ) ;
20
+ } ) ;
21
+
22
+ it ( 'provides a \'bind\' function and an \'unbind\' function' , inject ( function ( wheel ) {
23
+ expect ( angular . isFunction ( wheel . bind ) ) . toBe ( true ) ;
24
+ expect ( angular . isFunction ( wheel . unbind ) ) . toBe ( true ) ;
25
+ } ) ) ;
26
+
27
+ describe ( '.bind' , function ( ) {
28
+ var wheel ;
29
+
30
+ beforeEach ( inject ( function ( _wheel_ ) {
31
+ wheel = _wheel_ ;
32
+ } ) ) ;
33
+
34
+ it ( 'throws an error if up() and down() callbacks are not provided' , function ( ) {
35
+ expect ( function ( ) {
36
+ wheel . bind ( element , { } ) ;
37
+ } ) . toThrowError ( 'No callbacks provided' ) ;
38
+ } ) ;
39
+
40
+ it ( 'prevents the default wheel event in one direction if a callback for the same direction is provided' , function ( ) {
41
+ } ) ;
42
+
43
+ it ( 'does not prevents the default wheel event in one direction if a callback for that direction is not provided' , function ( ) {
44
+ } ) ;
45
+ } ) ;
46
+ } ) ;
You can’t perform that action at this time.
0 commit comments