@@ -60,34 +60,44 @@ def click(*_):
60
60
61
61
assert dash_duo .get_logs () == []
62
62
63
+
63
64
def test_rext002_render_external_component_temp (dash_duo ):
64
65
app = Dash ()
65
66
app .layout = html .Div (
66
67
[
67
68
dcc .Tabs (
68
69
[
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
+ },
80
87
},
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
+ ),
91
101
]
92
102
),
93
103
]
@@ -96,14 +106,22 @@ def test_rext002_render_external_component_temp(dash_duo):
96
106
dash_duo .start_server (app )
97
107
dash_duo .wait_for_text_to_equal ("#extra" , "extra children" )
98
108
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
+ )
101
114
102
- dash_duo .find_element (' .tab' ).click ()
115
+ dash_duo .find_element (" .tab" ).click ()
103
116
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"
105
120
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
+ )
108
126
109
127
assert dash_duo .get_logs () == []
0 commit comments