Merge remote-tracking branch 'origin/main' into feat/issue-67-playevent-datecriterion
# Conflicts: # common/components/filters.py # tests/test_filter_bars.py
This commit is contained in:
@@ -1515,16 +1515,19 @@ def _playevent_fields(existing: dict) -> list:
|
|||||||
max_value=ended_max,
|
max_value=ended_max,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
RangeSlider(
|
_filter_field(
|
||||||
label="Days to Finish",
|
"Days to Finish",
|
||||||
input_name_prefix="filter-days-to-finish",
|
RangeSlider(
|
||||||
min_value=days_min,
|
label="Days to Finish",
|
||||||
max_value=days_max,
|
input_name_prefix="filter-days-to-finish",
|
||||||
range_min=0,
|
min_value=days_min,
|
||||||
range_max=365,
|
max_value=days_max,
|
||||||
step="1",
|
range_min=0,
|
||||||
min_placeholder="e.g. 1",
|
range_max=365,
|
||||||
max_placeholder="e.g. 30",
|
step="1",
|
||||||
|
min_placeholder="e.g. 1",
|
||||||
|
max_placeholder="e.g. 30",
|
||||||
|
),
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
return fields
|
return fields
|
||||||
|
|||||||
@@ -276,6 +276,19 @@ class FilterBarRenderingTest(TestCase):
|
|||||||
html,
|
html,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def test_playevent_filter_bar_labels_days_to_finish_slider(self):
|
||||||
|
"""The Days to Finish range slider must be wrapped in a labelled field —
|
||||||
|
RangeSlider does not render its own label, so a bare slider shows none."""
|
||||||
|
from common.components import PlayEventFilterBar
|
||||||
|
|
||||||
|
html = str(
|
||||||
|
PlayEventFilterBar(
|
||||||
|
filter_json="", preset_list_url="/l", preset_save_url="/s"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
self.assertIn("Days to Finish", html)
|
||||||
|
self.assertNoEscapedTags(html)
|
||||||
|
|
||||||
def test_game_filter_bar_has_new_widgets(self):
|
def test_game_filter_bar_has_new_widgets(self):
|
||||||
"""The expanded games FilterBar exposes platform_group, device, playevent_note,
|
"""The expanded games FilterBar exposes platform_group, device, playevent_note,
|
||||||
purchase_type / purchase_ownership_type, plus count and aggregate-playtime
|
purchase_type / purchase_ownership_type, plus count and aggregate-playtime
|
||||||
|
|||||||
Reference in New Issue
Block a user