[verified] redesign trash with deadline groups
This commit is contained in:
@@ -400,6 +400,7 @@ def test_task_subtasks_and_recycle_bin(client):
|
||||
assert client.delete(f"/api/v1/tasks/{parent['id']}").status_code == 204
|
||||
trash = client.get("/api/v1/trash").json()["items"]
|
||||
assert len(trash) == 1
|
||||
assert trash[0]["subtasks"][0]["title"] == "比较价格"
|
||||
assert client.post(f"/api/v1/tasks/{parent['id']}/restore").status_code == 200
|
||||
|
||||
|
||||
@@ -566,6 +567,25 @@ def test_trash_cursor_paginates_more_than_fifty_items(client):
|
||||
assert second.json()["next_cursor"] is None
|
||||
|
||||
|
||||
def test_trash_page_orders_deadline_groups_globally(client):
|
||||
client = initialized_client(client)
|
||||
inbox = client.get("/api/v1/lists").json()[0]
|
||||
rows = [
|
||||
("无日期", None),
|
||||
("未来", "2099-12-30T15:59:00Z"),
|
||||
("过期", "2020-01-02T15:59:00Z"),
|
||||
]
|
||||
for title, due_at in rows:
|
||||
payload = {"title": title, "list_id": inbox["id"]}
|
||||
if due_at:
|
||||
payload.update({"due_at": due_at, "due_has_time": False})
|
||||
task = client.post("/api/v1/tasks", json=payload).json()
|
||||
assert client.delete(f"/api/v1/tasks/{task['id']}").status_code == 204
|
||||
|
||||
page = client.get("/api/v1/trash", params={"page": 1, "page_size": 50}).json()
|
||||
assert [item["title"] for item in page["items"]] == ["过期", "未来", "无日期"]
|
||||
|
||||
|
||||
def test_recycle_bin_restore_and_permanent_delete_include_subtasks(client):
|
||||
client = initialized_client(client)
|
||||
inbox = client.get("/api/v1/lists").json()[0]
|
||||
|
||||
Reference in New Issue
Block a user