Skip to content

Commit 1d957ea

Browse files
committed
fixed test
1 parent 2801e61 commit 1d957ea

File tree

1 file changed

+35
-4
lines changed

1 file changed

+35
-4
lines changed

tests/integration/callbacks/test_wildcards.py

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import pytest
22
import re
33
from selenium.webdriver.common.keys import Keys
4+
import json
45

56
from dash.testing import wait
67
import dash
@@ -10,6 +11,12 @@
1011
from tests.assets.grouping_app import grouping_app
1112

1213

14+
def stringify_id(id_):
15+
if isinstance(id_, dict):
16+
return json.dumps(id_, sort_keys=True, separators=(",", ":"))
17+
return id_
18+
19+
1320
def css_escape(s):
1421
sel = re.sub("[\\{\\}\\\"\\'.:,]", lambda m: "\\" + m.group(0), s)
1522
print(sel)
@@ -413,14 +420,38 @@ def assert_callback_context(items_text):
413420
args_grouping = dict(
414421
items=dict(
415422
all=[
416-
{"id": {"item": i}, "property": "children", "value": text}
423+
{
424+
"id": {"item": i},
425+
"property": "children",
426+
"value": text,
427+
"str_id": stringify_id({"item": i}),
428+
"triggered": False,
429+
}
417430
for i, text in enumerate(items_text[:-1])
418431
],
419-
new=dict(id="new-item", property="value", value=items_text[-1]),
432+
new=dict(
433+
id="new-item",
434+
property="value",
435+
value=items_text[-1],
436+
str_id="new-item",
437+
triggered=False,
438+
),
420439
),
421440
triggers=[
422-
{"id": "add", "property": "n_clicks", "value": len(items_text)},
423-
{"id": "new-item", "property": "n_submit"},
441+
{
442+
"id": "add",
443+
"property": "n_clicks",
444+
"value": len(items_text),
445+
"str_id": "add",
446+
"triggered": True,
447+
},
448+
{
449+
"id": "new-item",
450+
"property": "n_submit",
451+
"value": None,
452+
"str_id": "new-item",
453+
"triggered": False,
454+
},
424455
],
425456
)
426457
dash_duo.wait_for_text_to_equal("#cc-args-grouping", repr(args_grouping))

0 commit comments

Comments
 (0)