Allow translating select selector options (#85531)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Jan Bouwhuis 2023-01-17 16:22:19 +01:00 committed by GitHub
parent 096ef5da47
commit 25392655e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 0 deletions

View file

@ -419,6 +419,25 @@ def test_text_selector_schema(schema, valid_selections, invalid_selections):
("red", "green"),
("cat", 0, None, ["red"]),
),
(
{
"options": ["red", "green", "blue"],
"translation_key": "color",
},
("red", "green", "blue"),
("cat", 0, None, ["red"]),
),
(
{
"options": [
{"value": "red", "label": "Ruby Red"},
{"value": "green", "label": "Emerald Green"},
],
"translation_key": "color",
},
("red", "green"),
("cat", 0, None, ["red"]),
),
(
{"options": ["red", "green", "blue"], "multiple": True},
(["red"], ["green", "blue"], []),