@@ -19,15 +19,12 @@ describe('Drawing', function() {
1919 afterEach ( function ( ) {
2020 this . svg . remove ( ) ;
2121 this . g . remove ( ) ;
22-
23- // unstash base url from Drawing module object
24- delete Drawing . baseUrl ;
2522 } ) ;
2623
2724 it ( 'should set the clip-path attribute' , function ( ) {
2825 expect ( this . g . attr ( 'clip-path' ) ) . toBe ( null ) ;
2926
30- Drawing . setClipUrl ( this . g , 'id1' ) ;
27+ Drawing . setClipUrl ( this . g , 'id1' , { _context : { } } ) ;
3128
3229 expect ( this . g . attr ( 'clip-path' ) ) . toEqual ( 'url(#id1)' ) ;
3330 } ) ;
@@ -49,7 +46,7 @@ describe('Drawing', function() {
4946 // grab window URL
5047 var href = window . location . href ;
5148
52- Drawing . setClipUrl ( this . g , 'id3' ) ;
49+ Drawing . setClipUrl ( this . g , 'id3' , { _context : { baseUrl : href } } ) ;
5350
5451 expect ( this . g . attr ( 'clip-path' ) )
5552 . toEqual ( 'url(' + href + '#id3)' ) ;
@@ -63,10 +60,12 @@ describe('Drawing', function() {
6360 . attr ( 'href' , 'https://plot.ly/#hash' ) ;
6461
6562 window . location . hash = 'hash' ;
63+ var href = window . location . href ;
64+ var href2 = href . split ( '#' ) [ 0 ] ;
6665
67- Drawing . setClipUrl ( this . g , 'id4' ) ;
66+ Drawing . setClipUrl ( this . g , 'id4' , { _context : { baseUrl : href2 } } ) ;
6867
69- var expected = 'url(' + window . location . href . split ( '#' ) [ 0 ] + '#id4)' ;
68+ var expected = 'url(' + href2 + '#id4)' ;
7069
7170 expect ( this . g . attr ( 'clip-path' ) ) . toEqual ( expected ) ;
7271
0 commit comments