@@ -452,11 +452,17 @@ def test_external_files_init(self):
452
452
'https://www.google-analytics.com/analytics.js' ,
453
453
{'src' : 'https://cdn.polyfill.io/v2/polyfill.min.js' },
454
454
{
455
- 'src' : 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.core.js' ,
456
- 'integrity' : 'sha256-Qqd/EfdABZUcAxjOkMi8eGEivtdTkh3b65xCZL4qAQA=' ,
455
+ 'src' : 'https://cdnjs.cloudflare.com/ajax/libs/ramda/0.25.0/ramda.min.js' ,
456
+ 'integrity' : 'sha256-YN22NHB7zs5+LjcHWgk3zL0s+CRnzCQzDOFnndmUamY=' ,
457
+ 'crossorigin' : 'anonymous'
458
+ },
459
+ {
460
+ 'src' : 'https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.10/lodash.min.js' ,
461
+ 'integrity' : 'sha256-VKITM616rVzV+MI3kZMNUDoY5uTsuSl1ZvEeZhNoJVk=' ,
457
462
'crossorigin' : 'anonymous'
458
463
}
459
464
]
465
+
460
466
css_files = [
461
467
'https://codepen.io/chriddyp/pen/bWLwgP.css' ,
462
468
{
@@ -467,8 +473,30 @@ def test_external_files_init(self):
467
473
}
468
474
]
469
475
470
- app = dash .Dash (
471
- external_scripts = js_files , external_stylesheets = css_files )
476
+ app = dash .Dash (__name__ ,
477
+ external_scripts = js_files ,
478
+ external_stylesheets = css_files )
479
+
480
+ app .index_string = '''
481
+ <!DOCTYPE html>
482
+ <html>
483
+ <head>
484
+ {%metas%}
485
+ <title>{%title%}</title>
486
+ {%css%}
487
+ </head>
488
+ <body>
489
+ <div id="tested"></div>
490
+ <div id="ramda-test"></div>
491
+ <button type="button" id="btn">Btn</button>
492
+ {%app_entry%}
493
+ <footer>
494
+ {%config%}
495
+ {%scripts%}
496
+ </footer>
497
+ </body>
498
+ </html>
499
+ '''
472
500
473
501
app .layout = html .Div ()
474
502
@@ -482,3 +510,13 @@ def test_external_files_init(self):
482
510
(("//script[@src='{}']" , x ) for x in js_urls ),
483
511
(("//link[@href='{}']" , x ) for x in css_urls )):
484
512
self .driver .find_element_by_xpath (fmt .format (url ))
513
+
514
+ # Ensure the button style was overloaded by reset (set to 38px in codepen)
515
+ btn = self .driver .find_element_by_id ('btn' )
516
+ btn_height = btn .value_of_css_property ('height' )
517
+
518
+ self .assertEqual ('18px' , btn_height )
519
+
520
+ # ensure ramda was loaded before the assets so they can use it.
521
+ lo_test = self .driver .find_element_by_id ('ramda-test' )
522
+ self .assertEqual ('Hello World' , lo_test .text )
0 commit comments