@@ -6,14 +6,28 @@ describe('tilemaptest - TileMapSettingsTests-deprecated', function () {
6
6
let tilemapSettings ;
7
7
let tilemapsConfig ;
8
8
9
- beforeEach ( ngMock . module ( 'kibana' ) ) ;
9
+ beforeEach ( ngMock . module ( 'kibana' , ( $provide ) => {
10
+ $provide . decorator ( 'tilemapsConfig' , ( ) => ( {
11
+ manifestServiceUrl : 'https://proxy-tiles.elastic.co/v1/manifest' ,
12
+ deprecated : {
13
+ isOverridden : true ,
14
+ config : {
15
+ url : 'https://tiles.elastic.co/v1/default/{z}/{x}/{y}.png?my_app_name=kibana_tests' ,
16
+ options : {
17
+ minZoom : 1 ,
18
+ maxZoom : 10 ,
19
+ attribution : '© [Elastic Tile Service](https://www.elastic.co/elastic_tile_service)'
20
+ }
21
+ } ,
22
+ }
23
+ } ) ) ;
24
+ } ) ) ;
25
+
10
26
beforeEach ( ngMock . inject ( function ( $injector ) {
11
27
tilemapSettings = $injector . get ( 'tilemapSettings' ) ;
12
28
tilemapsConfig = $injector . get ( 'tilemapsConfig' ) ;
13
- tilemapsConfig . deprecated . isOverridden = true ;
14
29
} ) ) ;
15
30
16
-
17
31
describe ( 'getting settings' , function ( ) {
18
32
beforeEach ( async function ( ) {
19
33
await tilemapSettings . loadSettings ( ) ;
@@ -27,10 +41,8 @@ describe('tilemaptest - TileMapSettingsTests-deprecated', function () {
27
41
expect ( mapUrl ) . to . contain ( '{z}' ) ;
28
42
29
43
const urlObject = url . parse ( mapUrl , true ) ;
30
- expect ( urlObject . host ) . to . match ( / e l a s t i c .c o $ / ) ;
31
- expect ( urlObject . query ) . to . have . property ( 'my_app_name' ) ;
32
- expect ( urlObject . query ) . to . have . property ( 'my_app_version' ) ;
33
- expect ( urlObject . query ) . to . have . property ( 'elastic_tile_service_tos' ) ;
44
+ expect ( urlObject . hostname ) . to . be ( 'tiles.elastic.co' ) ;
45
+ expect ( urlObject . query ) . to . have . property ( 'my_app_name' , 'kibana_tests' ) ;
34
46
35
47
} ) ;
36
48
0 commit comments