mirror of
https://github.com/penpot/penpot.git
synced 2026-09-09 05:28:43 +00:00
🐛 Fix nitrate penpot-version schema
This commit is contained in:
parent
41996ed9a5
commit
2fbab08bde
@ -64,13 +64,26 @@
|
|||||||
;; ---- API: get-penpot-version
|
;; ---- API: get-penpot-version
|
||||||
|
|
||||||
(def ^:private schema:get-penpot-version-result
|
(def ^:private schema:get-penpot-version-result
|
||||||
[:map [:version ::sm/text]])
|
[:map
|
||||||
|
[:version
|
||||||
|
[:map
|
||||||
|
[:full [:maybe ::sm/text]]
|
||||||
|
[:branch [:maybe ::sm/text]]
|
||||||
|
[:base [:maybe ::sm/text]]
|
||||||
|
[:main [:maybe ::sm/text]]
|
||||||
|
[:major [:maybe ::sm/text]]
|
||||||
|
[:minor [:maybe ::sm/text]]
|
||||||
|
[:patch [:maybe ::sm/text]]
|
||||||
|
[:modifier [:maybe ::sm/text]]
|
||||||
|
[:commit [:maybe ::sm/text]]
|
||||||
|
[:commit-hash [:maybe ::sm/text]]]]])
|
||||||
|
|
||||||
(sv/defmethod ::get-penpot-version
|
(sv/defmethod ::get-penpot-version
|
||||||
"Get the current Penpot version"
|
"Get the current Penpot version"
|
||||||
{::doc/added "2.14"
|
{::doc/added "2.14"
|
||||||
::sm/params [:map]
|
::sm/params [:map]
|
||||||
::sm/result schema:get-penpot-version-result}
|
::sm/result schema:get-penpot-version-result
|
||||||
|
::rpc/auth false}
|
||||||
[_cfg _params]
|
[_cfg _params]
|
||||||
{:version cf/version})
|
{:version cf/version})
|
||||||
|
|
||||||
|
|||||||
@ -45,11 +45,15 @@
|
|||||||
(t/is (= :authentication-required (th/ex-code (:error out))))))
|
(t/is (= :authentication-required (th/ex-code (:error out))))))
|
||||||
|
|
||||||
(t/deftest get-penpot-version
|
(t/deftest get-penpot-version
|
||||||
(let [profile (th/create-profile* 1 {:is-active true})
|
(let [out (management-command-with-nitrate! {::th/type :get-penpot-version})
|
||||||
out (management-command-with-nitrate! {::th/type :get-penpot-version
|
version (-> out :result :version)]
|
||||||
::rpc/profile-id (:id profile)})]
|
|
||||||
(t/is (th/success? out))
|
(t/is (th/success? out))
|
||||||
(t/is (= cf/version (-> out :result :version)))))
|
(t/is (= #{:full :branch :base :main :major :minor :patch :modifier :commit :commit-hash}
|
||||||
|
(set (keys version))))
|
||||||
|
(doseq [k [:full :branch :base :main :major :minor :patch :modifier :commit :commit-hash]]
|
||||||
|
(t/is (or (nil? (get version k))
|
||||||
|
(string? (get version k)))))
|
||||||
|
(t/is (= cf/version version))))
|
||||||
|
|
||||||
(t/deftest get-teams-returns-only-owned-non-default-non-deleted
|
(t/deftest get-teams-returns-only-owned-non-default-non-deleted
|
||||||
(let [profile (th/create-profile* 1 {:is-active true})
|
(let [profile (th/create-profile* 1 {:is-active true})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user