From 511ad942ccfd3b038d46959b9900c10c3e06c99c Mon Sep 17 00:00:00 2001 From: Bruno Charest Date: Tue, 8 Sep 2026 12:26:45 -0400 Subject: [PATCH] =?UTF-8?q?test:=20ajout=20test=20tree=20is=5Fshared=20pou?= =?UTF-8?q?r=20pages=20partag=C3=A9es=20par=20lien?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_sharing.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/test_sharing.py b/tests/test_sharing.py index 043f693..2b75eb7 100644 --- a/tests/test_sharing.py +++ b/tests/test_sharing.py @@ -297,6 +297,30 @@ def test_page_editor_renders_page_is_shared(client): assert "pageIsShared:true" in r.text +def test_tree_is_shared_includes_link_shared_pages(client): + _auth(client, user_id=1, login="owner") + from app.db import get_conn + with get_conn() as conn: + ws = conn.execute("SELECT id FROM workspaces WHERE owner_id=1 LIMIT 1").fetchone() + if not ws: + return + ws_id = ws["id"] + cur = conn.execute( + "INSERT INTO pages (workspace, title, content, content_format, parent_section, share_mode, workspace_id) " + "VALUES ('WS', 'Link Shared WS', '[]', 'blocks', 'Workspace', 'anyone', ?)", + (ws_id,), + ) + conn.commit() + pid = cur.lastrowid + + r = client.get("/api/local-workspace/tree") + assert r.status_code == 200 + items = r.json().get("children", []) + match = [c for c in items if c.get("id") == pid] + assert match, f"page {pid} not found in tree" + assert match[0]["is_shared"] is True, "link-shared page should show is_shared=true in tree" + + def get_conn_ctx(): from app.db import get_conn return get_conn() \ No newline at end of file