fix: explain empty task searches and filters (#33 D4)
Core regression / Python core, intervention UI and release configuration (push) Successful in 5m27s
Core regression / JavaScript syntax (push) Successful in 8s
Core regression / JavaScript syntax (pull_request) Successful in 6s
Core regression / Python core, intervention UI and release configuration (pull_request) Successful in 4m54s
Core regression / Python core, intervention UI and release configuration (push) Successful in 5m27s
Core regression / JavaScript syntax (push) Successful in 8s
Core regression / JavaScript syntax (pull_request) Successful in 6s
Core regression / Python core, intervention UI and release configuration (pull_request) Successful in 4m54s
This commit is contained in:
1 parent
46deb9cec8
commit
63999b7bfd
2 files changed
+37
-1
No files matched your search
@@ -27,6 +27,26 @@ def visible_ids(panel):
|
||||
return [panel.list.item(index).data(Qt.ItemDataRole.UserRole) for index in range(panel.list.count())]
|
||||
|
||||
|
||||
def test_empty_list_explains_search_filter_and_initial_state(navigation, qtbot):
|
||||
panel, tasks, opened = navigation
|
||||
panel.populate(tasks[:1])
|
||||
qtbot.keyClicks(panel.search, 'zzzz_no_match')
|
||||
assert panel.empty_hint.isVisible()
|
||||
assert 'zzzz_no_match' in panel.empty_hint.text()
|
||||
assert '匹配 0 / 共 1 个任务' in panel.count.text()
|
||||
panel.filter.setCurrentIndex(panel.filter.findData('completed'))
|
||||
assert '已完成' in panel.empty_hint.text() and 'zzzz_no_match' in panel.empty_hint.text()
|
||||
panel.search.clear()
|
||||
assert '已完成' in panel.empty_hint.text()
|
||||
panel.filter.setCurrentIndex(panel.filter.findData('all'))
|
||||
assert not panel.empty_hint.isVisible() and len(visible_ids(panel)) == 1
|
||||
panel.populate(())
|
||||
assert '新建任务' in panel.empty_hint.text()
|
||||
panel.recycle_button.setChecked(True)
|
||||
panel.populate(())
|
||||
assert '回收站' in panel.empty_hint.text()
|
||||
|
||||
|
||||
@pytest.mark.parametrize(('category','expected'),[
|
||||
('all',['draft','ready','running','paused','completed','failed','blocked']),
|
||||
('unfinished',['draft','ready','running','paused','failed','blocked']),
|
||||
|
||||
Reference in new issue
Block a user