@@ -4,45 +4,48 @@ describe('formlyMaterial', () => {
4
4
//
5
5
let formlyMaterial ;
6
6
let formlyMaterialPr ;
7
+ let prefix ;
7
8
8
9
//
9
10
// tests
10
11
//
11
-
12
+
12
13
beforeEach ( ( ) => {
13
14
angular . module ( 'formlyMaterialMock' , [ ] )
14
15
. config ( ( formlyMaterialProvider ) => {
15
16
formlyMaterialPr = formlyMaterialProvider
16
17
} ) ;
17
18
module ( 'formlyMaterial' , 'formlyMaterialMock' ) ;
18
-
19
+
19
20
angular . module ( 'testApp' , [ 'angular-meteor' , 'formly' , 'formlyMaterial' , 'ngMock' ] ) ;
20
21
module ( 'testApp' ) ;
21
22
22
23
inject ( function ( $templateCache , $httpBackend , _formlyMaterial_ ) {
23
24
$httpBackend . whenGET ( / \. h t m l $ / i) . respond ( ( method , url ) => $templateCache . get ( url ) ) ;
24
25
formlyMaterial = _formlyMaterial_ ;
25
26
} ) ;
27
+
28
+ if ( meteorVersionCompare . lt ( '1.2' ) ) {
29
+ prefix = "/packages/wieldo_angular-formly-templates-material_" ;
30
+ } else {
31
+ prefix = "/packages/wieldo:angular-formly-templates-material/" ;
32
+ }
26
33
} ) ;
27
34
28
35
it ( "should be injectable" , ( ) => {
29
36
expect ( formlyMaterial ) . toBeDefined ( ) ;
30
37
} ) ;
31
38
32
39
it ( "should be able to add prefix to templateUrl using factory" , ( ) => {
33
- const prefix = "/packages/wieldo:angular-formly-templates-material/" ;
34
-
35
- expect ( formlyMaterial . templateUrl ( "test.html" ) ) . toBe ( prefix + "test.html" ) ;
36
- expect ( formlyMaterial . templateUrl ( "/test.html" ) ) . toBe ( prefix + "test.html" ) ;
37
- expect ( formlyMaterial . templateUrl ( "/test/test.html" ) ) . toBe ( prefix + "test/test.html" ) ;
40
+ expect ( formlyMaterial . templateUrl ( "client/test.html" ) ) . toBe ( prefix + "client/test.html" ) ;
41
+ expect ( formlyMaterial . templateUrl ( "/client/test.html" ) ) . toBe ( prefix + "client/test.html" ) ;
42
+ expect ( formlyMaterial . templateUrl ( "/client/test/test.html" ) ) . toBe ( prefix + "client/test/test.html" ) ;
38
43
} ) ;
39
44
40
45
it ( "should be able to add prefix to templateUrl using provider" , ( ) => {
41
- const prefix = "/packages/wieldo:angular-formly-templates-material/" ;
42
-
43
- expect ( formlyMaterialPr . templateUrl ( "test.html" ) ) . toBe ( prefix + "test.html" ) ;
44
- expect ( formlyMaterialPr . templateUrl ( "/test.html" ) ) . toBe ( prefix + "test.html" ) ;
45
- expect ( formlyMaterialPr . templateUrl ( "/test/test.html" ) ) . toBe ( prefix + "test/test.html" ) ;
46
+ expect ( formlyMaterialPr . templateUrl ( "client/test.html" ) ) . toBe ( prefix + "client/test.html" ) ;
47
+ expect ( formlyMaterialPr . templateUrl ( "/client/test.html" ) ) . toBe ( prefix + "client/test.html" ) ;
48
+ expect ( formlyMaterialPr . templateUrl ( "/client/test/test.html" ) ) . toBe ( prefix + "client/test/test.html" ) ;
46
49
} ) ;
47
50
48
51
} ) ;
0 commit comments