refactor: remove manual refresh and search controls
ci / gitleaks (push) Successful in 8s
ci / docker (push) Successful in 7m17s

This commit is contained in:
2026-09-19 21:15:23 +08:00
parent 0cf1c49094
commit 4973d56a64
29 changed files with 244 additions and 860 deletions
+7 -5
View File
@@ -87,7 +87,7 @@ def test_update_memo_validates_title_length_after_trimming(client):
).status_code == 422
def test_list_memos_scopes_searches_orders_paginates_and_builds_excerpt(client):
def test_list_memos_scopes_orders_paginates_and_builds_excerpt(client):
boot(client)
first = client.post(
"/api/v1/memos", json={"title": "Alpha note", "content": " many\n words\tinside "}
@@ -98,7 +98,7 @@ def test_list_memos_scopes_searches_orders_paginates_and_builds_excerpt(client):
third = client.post("/api/v1/memos", json={"title": "Third"}).json()
assert client.delete(f"/api/v1/memos/{third['id']}").status_code == 204
page = client.get("/api/v1/memos", params={"scope": "active", "q": "ALPHA", "page_size": 1})
page = client.get("/api/v1/memos", params={"scope": "active", "page_size": 1})
assert page.status_code == 200
data = page.json()
assert data["total"] == 2
@@ -109,7 +109,7 @@ def test_list_memos_scopes_searches_orders_paginates_and_builds_excerpt(client):
assert "content" not in data["items"][0]
second_page = client.get(
"/api/v1/memos", params={"scope": "active", "q": "alpha", "page": 2, "page_size": 1}
"/api/v1/memos", params={"scope": "active", "page": 2, "page_size": 1}
).json()
assert second_page["items"][0]["id"] == first["id"]
assert second_page["items"][0]["excerpt"] == "many words inside"
@@ -267,11 +267,13 @@ def test_restore_reassigns_foreign_memo_to_current_user(client):
}]
response = client.post("/api/v1/restore?mode=merge", json=exported)
assert response.status_code == 200
imported = client.get("/api/v1/memos", params={"q": "Imported"}).json()["items"][0]
imported_items = client.get("/api/v1/memos", params={"page_size": 100}).json()["items"]
imported = next(item for item in imported_items if item["title"] == "Imported")
assert imported["id"] != foreign_id
assert client.get(f"/api/v1/memos/{imported['id']}").json()["content"] == "owned here"
assert client.post("/api/v1/restore?mode=merge", json=exported).status_code == 200
assert client.get("/api/v1/memos", params={"q": "Imported"}).json()["total"] == 1
memo_items = client.get("/api/v1/memos", params={"page_size": 100}).json()["items"]
assert sum(item["title"] == "Imported" for item in memo_items) == 1
def test_legacy_backup_without_memos_still_restores(client):