1
1
describe ( 'Ionic Content directive' , function ( ) {
2
- var compile , element , scope , platform = 'Android' ;
2
+ var compile , element , scope ;
3
3
4
- //beforeEach(module('ionic'));
5
-
6
- beforeEach ( module ( 'ionic' , function ( $provide ) {
7
- $provide . value ( '$ionicPlatform' , {
8
- is : function ( type ) {
9
- return type === platform ;
10
- }
11
- } ) ;
12
- } ) ) ;
4
+ beforeEach ( module ( 'ionic.ui.content' ) ) ;
13
5
14
6
beforeEach ( inject ( function ( $compile , $rootScope , $timeout , $window ) {
15
7
compile = $compile ;
16
8
scope = $rootScope ;
17
9
timeout = $timeout ;
18
10
window = $window ;
11
+ ionic . Platform . setPlatform ( 'Android' ) ;
19
12
} ) ) ;
20
13
21
14
it ( 'Has content class' , function ( ) {
@@ -37,7 +30,7 @@ describe('Ionic Content directive', function() {
37
30
} ) ;
38
31
39
32
it ( 'Enables bouncing by default' , function ( ) {
40
- platform = 'iPhone' ;
33
+ ionic . Platform . setPlatform ( 'iPhone' ) ;
41
34
element = compile ( '<content has-header="true"></content>' ) ( scope ) ;
42
35
timeout . flush ( ) ;
43
36
var newScope = element . isolateScope ( ) ;
@@ -46,7 +39,7 @@ describe('Ionic Content directive', function() {
46
39
} ) ;
47
40
48
41
it ( 'Disables bouncing when has-bouncing = false' , function ( ) {
49
- platform = 'iPhone' ;
42
+ ionic . Platform . setPlatform ( 'iPhone' ) ;
50
43
element = compile ( '<content has-header="true" has-bouncing="false"></content>' ) ( scope ) ;
51
44
timeout . flush ( ) ;
52
45
var newScope = element . isolateScope ( ) ;
@@ -55,7 +48,7 @@ describe('Ionic Content directive', function() {
55
48
} ) ;
56
49
57
50
it ( 'Disables bouncing by default on Android' , function ( ) {
58
- platform = 'Android' ;
51
+ ionic . Platform . setPlatform ( 'Android' ) ;
59
52
element = compile ( '<content has-header="true"></content>' ) ( scope ) ;
60
53
timeout . flush ( ) ;
61
54
var newScope = element . isolateScope ( ) ;
@@ -64,7 +57,7 @@ describe('Ionic Content directive', function() {
64
57
} ) ;
65
58
66
59
it ( 'Disables bouncing by default on Android unless has-bouncing = true' , function ( ) {
67
- platform = 'Android' ;
60
+ ionic . Platform . setPlatform ( 'Android' ) ;
68
61
element = compile ( '<content has-header="true" has-bouncing="true"></content>' ) ( scope ) ;
69
62
timeout . flush ( ) ;
70
63
var newScope = element . isolateScope ( ) ;
0 commit comments