Skip to content

Commit 7de127a

Browse files
committed
fixing for lint
1 parent 0988888 commit 7de127a

File tree

2 files changed

+46
-32
lines changed

2 files changed

+46
-32
lines changed

dash/dash-renderer/src/wrapper/ExternalWrapper.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@ type Props = {
1919
/**
2020
* For rendering components that are out of the regular layout tree.
2121
*/
22-
function ExternalWrapper({
23-
component,
24-
componentPath,
25-
temp = false
26-
}: Props) {
22+
function ExternalWrapper({component, componentPath, temp = false}: Props) {
2723
const dispatch: any = useDispatch();
2824
const [inserted, setInserted] = useState(false);
2925

tests/integration/renderer/test_external_component.py

Lines changed: 45 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,34 +60,44 @@ def click(*_):
6060

6161
assert dash_duo.get_logs() == []
6262

63+
6364
def 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

Comments
 (0)