Skip to content

Commit

Permalink
adapt devtools test_prop_check suite
Browse files Browse the repository at this point in the history
`invalid-nested-prop` became `allow-nested-prop`
in dash 2.1.0

moreover, use same css query as in the python
version of the `test_props_check.py` suite
  • Loading branch information
etpinard committed Jun 21, 2023
1 parent 6eb9c06 commit 95d0561
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ test_cases = Dict(
"component"=> dcc_checklist,
"props"=> (options = [Dict("label" => "hello")], value = ["test"]),
),
"invalid-nested-prop"=> Dict(
"fail"=> true,
"name"=> "invalid nested prop",
"component"=> dcc_checklist,
"props"=> (options = [Dict("label"=> "hello", "value"=> true)], value = ["test"]),
),
"invalid-arrayOf"=> Dict(
"fail"=> true,
"name"=> "invalid arrayOf",
Expand Down Expand Up @@ -73,6 +67,12 @@ test_cases = Dict(
"component"=> html_div,
"props"=> (children = Dict("hello" => "world"),),
),
"allow-nested-prop"=> Dict(
"fail"=> false,
"name"=> "allow nested prop",
"component"=> dcc_checklist,
"props"=> (options = [Dict("label"=> "hello", "value"=> true)], value = ["test"]),
),
"allow-null-2"=> Dict(
"fail"=> false,
"name"=> "allow null as value",
Expand Down
11 changes: 6 additions & 5 deletions test/integration/devtools/test_props_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ def jl_test_file_path(filename):
"fail": True,
"name": 'missing required "value" inside options',
},
"invalid-nested-prop": {
"fail": True,
"name": "invalid nested prop",
},
"invalid-arrayOf": {
"fail": True,
"name": "invalid arrayOf",
Expand Down Expand Up @@ -56,6 +52,10 @@ def jl_test_file_path(filename):
"fail": True,
"name": "returning a dictionary",
},
"allow-nested-prop": {
"fail": False,
"name": "allow nested prop",
},
"allow-null-2": {
"fail": False,
"name": "allow null as value",
Expand Down Expand Up @@ -99,6 +99,7 @@ def test_jldvpc001_prop_check_errors_with_path(dashjl):

if test_cases[tc]["fail"]:
dashjl.wait_for_element(".test-devtools-error-toggle", timeout=10).click()
dashjl.wait_for_element(".dash-error-card")
dashjl.wait_for_element(".dash-fe-error__info")
else:
dashjl.wait_for_element("#new-component", timeout=2)
dashjl.wait_for_no_elements(".test-devtools-error-toggle")

0 comments on commit 95d0561

Please sign in to comment.