@@ -38,7 +38,7 @@ describe("templateFactory", () => {
3838
3939 describe ( "template URL behavior" , ( ) => {
4040 it ( "fetches relative URLs correctly" , async ( ) => {
41- const res = $templateFactory . fromUrl ( "/mock/hello" ) ;
41+ const res = await $templateFactory . fromUrl ( "/mock/hello" ) ;
4242 await wait ( 100 ) ;
4343 expect ( await res ) . toEqual ( "Hello" ) ;
4444 } ) ;
@@ -86,13 +86,9 @@ describe("templateFactory", () => {
8686 } ) ;
8787 } ) ;
8888
89- it ( "does not restrict URL loading" , function ( ) {
90- expect ( ( ) => {
91- $templateFactory . fromUrl ( "http://evil.com/views/view.html" ) ;
92- } ) . not . toThrowError ( ) ;
93-
94- expect ( ( ) => {
95- $templateFactory . fromUrl ( "data:text/html,foo" ) ;
89+ it ( "does not restrict URL loading" , async ( ) => {
90+ expect ( async ( ) => {
91+ await $templateFactory . fromUrl ( "data:text/html,foo" ) ;
9692 } ) . not . toThrowError ( ) ;
9793 } ) ;
9894 } ) ;
@@ -142,14 +138,14 @@ describe("templateFactory", () => {
142138 component : "dataComponent" ,
143139 } ) ;
144140 $stateService . go ( "cmp" ) ;
145- await wait ( ) ;
141+ await wait ( 100 ) ;
146142 expect ( el . innerHTML ) . toMatch ( / \< x - d a t a - c o m p o n e n t / ) ;
147143 } ) ;
148144
149145 it ( "should prefix the components dom element with x- for components named xFoo" , async ( ) => {
150146 $stateRegistry . register ( { name : "cmp" , component : "xComponent" } ) ;
151147 $stateService . go ( "cmp" ) ;
152- await wait ( ) ;
148+ await wait ( 100 ) ;
153149 expect ( el . innerHTML ) . toMatch ( / \< x - x - c o m p o n e n t / ) ;
154150 } ) ;
155151 } ) ;
0 commit comments