mirror of
https://github.com/penpot/penpot.git
synced 2026-08-30 00:29:17 +00:00
🐛 Add membership-side test for share-link token visibility
Add test coverage for the allow side of the share-link token filtering: team members and file owners should still see all share-links, while anonymous share-link holders only see their own token. This protects the (:type perms) = :share-link guard from accidental regression that could break the owner's share-link management dialog. AI-assisted-by: qwen3.7-plus
This commit is contained in:
parent
e57d949a7e
commit
bba0789a35
@ -188,4 +188,20 @@
|
||||
(t/is (= link-a-id (:id (first share-links))))
|
||||
|
||||
;; Should NOT see Link B's token
|
||||
(t/is (not (some #(= link-b-id (:id %)) share-links)))))))
|
||||
(t/is (not (some #(= link-b-id (:id %)) share-links)))))
|
||||
|
||||
(t/testing "team member still sees all share-links"
|
||||
(let [out (th/command! {::th/type :get-view-only-bundle
|
||||
::rpc/profile-id (:id owner)
|
||||
:file-id (:id file)})
|
||||
err (:error out)
|
||||
result (:result out)
|
||||
share-links (:share-links result)]
|
||||
|
||||
;; Should not error
|
||||
(t/is (nil? err))
|
||||
|
||||
;; Team member should see both share-links
|
||||
(t/is (= 2 (count share-links)))
|
||||
(t/is (some #(= link-a-id (:id %)) share-links))
|
||||
(t/is (some #(= link-b-id (:id %)) share-links))))))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user