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,17 +79,24 @@
::sut/name "A Note"}}))) ::sut/name "A Note"}})))
(deftest Like-test (deftest Like-test
(is (s/valid? ::sut/Like (testing "likes for mastodon notes"
{::sut/summary "Sally liked a note", (is (s/valid? ::sut/Like
::sut/type "Like", {::sut/summary "Sally liked a note",
::sut/actor {::sut/type "Person", ::sut/type "Like",
::sut/name "Sally"}, ::sut/actor {::sut/type "Person",
::sut/object "http://example.org/notes/1"})) ::sut/name "Sally"},
(is (s/valid? ::sut/Like ::sut/object "http://example.org/notes/1"}))
{::sut/id "foo", (is (s/valid? ::sut/Like
::sut/type "Like", {::sut/id "foo",
::sut/actor "https://social.bla/alyssa", ::sut/type "Like",
::sut/object "http://example.org/notes/1"}))) ::sut/actor "https://social.bla/alyssa",
::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