@@ -60,34 +60,44 @@ def click(*_):
6060
6161 assert dash_duo .get_logs () == []
6262
63+
6364def test_rext002_render_external_component_temp (dash_duo ):
6465 app = Dash ()
6566 app .layout = html .Div (
6667 [
6768 dcc .Tabs (
6869 [
69- dcc .Tab (label = "Tab 1" , children = [
70- ExternalComponent (
71- id = "ext" ,
72- extra_component = {
73- "type" : "Div" ,
74- "namespace" : "dash_html_components" ,
75- "props" : {
76- "id" : "extra" ,
77- "children" : [
78- html .Div ("extra children" , id = {"type" : "extra" , "index" : 1 })
79- ],
70+ dcc .Tab (
71+ label = "Tab 1" ,
72+ children = [
73+ ExternalComponent (
74+ id = "ext" ,
75+ extra_component = {
76+ "type" : "Div" ,
77+ "namespace" : "dash_html_components" ,
78+ "props" : {
79+ "id" : "extra" ,
80+ "children" : [
81+ html .Div (
82+ "extra children" ,
83+ id = {"type" : "extra" , "index" : 1 },
84+ )
85+ ],
86+ },
8087 },
81- },
82- extra_component_temp = True
83- ),
84- ]),
85- dcc .Tab (label = 'Tab 2' , children = [
86- ExternalComponent (
87- id = "without-id" ,
88- text = "without-id" ,
89- ),
90- ])
88+ extra_component_temp = True ,
89+ ),
90+ ],
91+ ),
92+ dcc .Tab (
93+ label = "Tab 2" ,
94+ children = [
95+ ExternalComponent (
96+ id = "without-id" ,
97+ text = "without-id" ,
98+ ),
99+ ],
100+ ),
91101 ]
92102 ),
93103 ]
@@ -96,14 +106,22 @@ def test_rext002_render_external_component_temp(dash_duo):
96106 dash_duo .start_server (app )
97107 dash_duo .wait_for_text_to_equal ("#extra" , "extra children" )
98108
99- dash_duo .find_element ('.tab:nth-child(2)' ).click ()
100- assert dash_duo .find_element ("#without-id > input" ).get_attribute ('value' ) == "without-id"
109+ dash_duo .find_element (".tab:nth-child(2)" ).click ()
110+ assert (
111+ dash_duo .find_element ("#without-id > input" ).get_attribute ("value" )
112+ == "without-id"
113+ )
101114
102- dash_duo .find_element (' .tab' ).click ()
115+ dash_duo .find_element (" .tab" ).click ()
103116 dash_duo .find_element ("#ext" )
104- assert len (dash_duo .find_elements ('#ext > *' )) == 0 , "extra component should be removed"
117+ assert (
118+ len (dash_duo .find_elements ("#ext > *" )) == 0
119+ ), "extra component should be removed"
105120
106- dash_duo .find_element ('.tab:nth-child(2)' ).click ()
107- assert dash_duo .find_element ("#without-id > input" ).get_attribute ('value' ) == "without-id"
121+ dash_duo .find_element (".tab:nth-child(2)" ).click ()
122+ assert (
123+ dash_duo .find_element ("#without-id > input" ).get_attribute ("value" )
124+ == "without-id"
125+ )
108126
109127 assert dash_duo .get_logs () == []
0 commit comments