Skip to content

Commit 92040d7

Browse files
committed
fix tests with paths
1 parent 533af1f commit 92040d7

File tree

5 files changed

+34
-17
lines changed

5 files changed

+34
-17
lines changed

tests/async_tests/test_async_callbacks.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,10 @@ async def update_input(value):
119119
paths = dash_duo.redux_state_paths
120120
assert paths["objs"] == {}
121121
assert paths["strs"] == {
122-
"input": ["props", "children", 0],
123-
"output": ["props", "children", 1],
122+
"input": ["components", "props", "children", 0],
123+
"output": ["components", "props", "children", 1],
124124
"sub-input-1": [
125+
"components",
125126
"props",
126127
"children",
127128
1,
@@ -132,6 +133,7 @@ async def update_input(value):
132133
0,
133134
],
134135
"sub-output-1": [
136+
"components",
135137
"props",
136138
"children",
137139
1,

tests/integration/callbacks/state_path.json

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"chapter1": {
33
"objs": {},
44
"strs": {
5-
"toc": ["props", "children", 0],
6-
"body": ["props", "children", 1],
5+
"toc": ["components", "props", "children", 0],
6+
"body": ["components", "props", "children", 1],
77
"chapter1-header": [
8+
"components",
89
"props",
910
"children",
1011
1,
@@ -15,6 +16,7 @@
1516
0
1617
],
1718
"chapter1-controls": [
19+
"components",
1820
"props",
1921
"children",
2022
1,
@@ -25,6 +27,7 @@
2527
1
2628
],
2729
"chapter1-label": [
30+
"components",
2831
"props",
2932
"children",
3033
1,
@@ -35,6 +38,7 @@
3538
2
3639
],
3740
"chapter1-graph": [
41+
"components",
3842
"props",
3943
"children",
4044
1,
@@ -49,9 +53,10 @@
4953
"chapter2": {
5054
"objs": {},
5155
"strs": {
52-
"toc": ["props", "children", 0],
53-
"body": ["props", "children", 1],
56+
"toc": ["components", "props", "children", 0],
57+
"body": ["components", "props", "children", 1],
5458
"chapter2-header": [
59+
"components",
5560
"props",
5661
"children",
5762
1,
@@ -62,6 +67,7 @@
6267
0
6368
],
6469
"chapter2-controls": [
70+
"components",
6571
"props",
6672
"children",
6773
1,
@@ -72,6 +78,7 @@
7278
1
7379
],
7480
"chapter2-label": [
81+
"components",
7582
"props",
7683
"children",
7784
1,
@@ -82,6 +89,7 @@
8289
2
8390
],
8491
"chapter2-graph": [
92+
"components",
8593
"props",
8694
"children",
8795
1,
@@ -96,9 +104,10 @@
96104
"chapter3": {
97105
"objs": {},
98106
"strs": {
99-
"toc": ["props", "children", 0],
100-
"body": ["props", "children", 1],
107+
"toc": ["components", "props", "children", 0],
108+
"body": ["components", "props", "children", 1],
101109
"chapter3-header": [
110+
"components",
102111
"props",
103112
"children",
104113
1,
@@ -112,6 +121,7 @@
112121
0
113122
],
114123
"chapter3-label": [
124+
"components",
115125
"props",
116126
"children",
117127
1,
@@ -125,6 +135,7 @@
125135
1
126136
],
127137
"chapter3-graph": [
138+
"components",
128139
"props",
129140
"children",
130141
1,
@@ -138,6 +149,7 @@
138149
2
139150
],
140151
"chapter3-controls": [
152+
"components",
141153
"props",
142154
"children",
143155
1,

tests/integration/callbacks/test_basic_callback.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ def update_input(value):
113113
paths = dash_duo.redux_state_paths
114114
assert paths["objs"] == {}
115115
assert paths["strs"] == {
116-
"input": ["props", "children", 0],
117-
"output": ["props", "children", 1],
116+
"input": ["components", "props", "children", 0],
117+
"output": ["components", "props", "children", 1],
118118
"sub-input-1": [
119+
"components",
119120
"props",
120121
"children",
121122
1,
@@ -126,6 +127,7 @@ def update_input(value):
126127
0,
127128
],
128129
"sub-output-1": [
130+
"components",
129131
"props",
130132
"children",
131133
1,

tests/integration/callbacks/test_layout_paths_with_callbacks.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def snapshot(name):
3737
html.Div(id="body"),
3838
]
3939
)
40-
for script in dcc._js_dist:
41-
app.scripts.append_script(script)
40+
# for script in dcc._js_dist:
41+
# app.scripts.append_script(script)
4242

4343
chapters = {
4444
"chapter1": html.Div(
@@ -183,7 +183,7 @@ def check_chapter(chapter):
183183
)
184184
== value
185185
),
186-
TIMEOUT,
186+
20,
187187
)
188188

189189
assert not dash_duo.redux_state_is_loading, "loadingMap is empty"
@@ -237,8 +237,8 @@ def check_call_counts(chapters, count):
237237
), "each element should exist in the dom"
238238

239239
assert paths["strs"] == {
240-
"toc": ["props", "children", 0],
241-
"body": ["props", "children", 1],
240+
"toc": ["components", "props", "children", 0],
241+
"body": ["components", "props", "children", 1],
242242
}
243243

244244
dash_duo.find_elements('input[type="radio"]')[0].click()

tests/integration/renderer/test_due_diligence.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def test_rddd001_initial_state(dash_duo):
7171
assert dash_duo.get_logs() == [], "Check that no errors or warnings were displayed"
7272

7373
assert dash_duo.driver.execute_script(
74-
"return JSON.parse(JSON.stringify(window.store.getState().layout))"
74+
"return JSON.parse(JSON.stringify(window.store.getState().layout)).components"
7575
) == json.loads(
7676
json.dumps(app.layout, cls=plotly.utils.PlotlyJSONEncoder)
7777
), "the state layout is identical to app.layout"
@@ -83,7 +83,8 @@ def test_rddd001_initial_state(dash_duo):
8383
paths = dash_duo.redux_state_paths
8484
assert paths["objs"] == {}
8585
assert paths["strs"] == {
86-
abbr: [
86+
abbr: ["components"]
87+
+ [
8788
int(token)
8889
if token in string.digits
8990
else token.replace("p", "props").replace("c", "children")

0 commit comments

Comments
 (0)