add a like test for a repository star

This commit is contained in:
Michael Jerger 2023-10-14 12:09:56 +02:00
parent 5d8f08488f
commit 5a7a6653ab
3 changed files with 21 additions and 14 deletions

View file

@ -1,4 +1,4 @@
(ns org.domaindrivenarchitecture.fed-poc.forge (ns org.domaindrivenarchitecture.fed-poc.forgefed
(:require [clojure.spec.alpha :as s] (:require [clojure.spec.alpha :as s]
[orchestra.core :refer [defn-spec]] [orchestra.core :refer [defn-spec]]
[org.domaindrivenarchitecture.fed-poc.spec-helper :as sh] [org.domaindrivenarchitecture.fed-poc.spec-helper :as sh]

View file

@ -79,6 +79,7 @@
::sut/name "A Note"}}))) ::sut/name "A Note"}})))
(deftest Like-test (deftest Like-test
(testing "likes for mastodon notes"
(is (s/valid? ::sut/Like (is (s/valid? ::sut/Like
{::sut/summary "Sally liked a note", {::sut/summary "Sally liked a note",
::sut/type "Like", ::sut/type "Like",
@ -90,6 +91,12 @@
::sut/type "Like", ::sut/type "Like",
::sut/actor "https://social.bla/alyssa", ::sut/actor "https://social.bla/alyssa",
::sut/object "http://example.org/notes/1"}))) ::sut/object "http://example.org/notes/1"})))
(testing "likes for forgejo repositories"
(is (s/valid? ::sut/Like
{::sut/type "Like",
::sut/actor "https://repo.prod.meissa.de/jem",
::sut/object "https://codeberg.org/forgejo/forgejo.git"})))
)
(deftest Object-test (deftest Object-test
(is (s/valid? ::sut/Object (is (s/valid? ::sut/Object

View file

@ -1,10 +1,10 @@
(ns org.domaindrivenarchitecture.fed-poc.forge-test (ns org.domaindrivenarchitecture.fed-poc.forgefed-test
(:require (:require
[clojure.test :refer [deftest is are testing run-tests]] [clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.fed-poc.security :as sec] [org.domaindrivenarchitecture.fed-poc.security :as sec]
[org.domaindrivenarchitecture.fed-poc.activitystreams2 :as as] [org.domaindrivenarchitecture.fed-poc.activitystreams2 :as as]
[org.domaindrivenarchitecture.fed-poc.forge :as sut])) [org.domaindrivenarchitecture.fed-poc.forgefed :as sut]))
(deftest Repository-test (deftest Repository-test
(is (s/valid? ::sut/Repository (is (s/valid? ::sut/Repository