Allow setting number selector step size to 'any' (#78265)

* Allow setting number selector step size to 'any'

* Improve test coverage
This commit is contained in:
Erik Montnemery
2022-09-15 08:29:46 +02:00
committed by GitHub
parent 30702bdcd2
commit 84a812ad05
3 changed files with 19 additions and 9 deletions

View File

@@ -241,6 +241,7 @@ def test_area_selector_schema(schema, valid_selections, invalid_selections):
),
({"min": 10, "max": 1000, "mode": "slider", "step": 0.5}, (), ()),
({"mode": "box"}, (10,), ()),
({"mode": "box", "step": "any"}, (), ()),
),
)
def test_number_selector_schema(schema, valid_selections, invalid_selections):
@@ -253,6 +254,12 @@ def test_number_selector_schema(schema, valid_selections, invalid_selections):
(
{}, # Must have mandatory fields
{"mode": "slider"}, # Must have min+max in slider mode
{
"mode": "slider",
"min": 0,
"max": 1,
"step": "any", # Can't combine slider with step any
},
),
)
def test_number_selector_schema_error(schema):