From 4bf90ae278f5633f880bb7261a4ed389c07ff20b Mon Sep 17 00:00:00 2001 From: erik Date: Thu, 22 Jun 2023 15:45:38 +0200 Subject: [PATCH] Implement simple test --- .../activity_pub_poc/core_test.clj | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj b/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj index 621df7d..4bb3f1f 100644 --- a/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj +++ b/src/test/clj/org/domaindrivenarchitecture/activity_pub_poc/core_test.clj @@ -1,6 +1,21 @@ (ns org.domaindrivenarchitecture.activity-pub-poc.core-test - (:require [clojure.test :refer :all] - [org.domaindrivenarchitecture.activity-pub-poc.core :as sut])) + (:require + [clojure.test :refer [deftest is are testing run-tests]] + [clojure.spec.test.alpha :as st] + [org.domaindrivenarchitecture.activity-pub-poc.core :as sut])) -(deftest get-property-type-from-ld-resource - (is (= 0 1))) \ No newline at end of file +(st/instrument `sut/generate-like-map) + +(def test-like-data + {:to "https://chatty.bla/ben/" + :target "posts/234s23-2g34234-2hhj536" + :from "https://social.bla/alyssa/"}) + +(deftest produces-valid-like + (is (= {"@context" "https://www.w3.org/ns/activitystreams", + "type" "Like", + "id" "https://social.bla/alyssa/out/sdfsd44243g324g3455", + "to" "https://chatty.bla/ben/", + "actor" "https://social.bla/alyssa/", + "object" "posts/234s23-2g34234-2hhj536"} + (sut/generate-like-map test-like-data)))) \ No newline at end of file