Add Link as Object Type to spec; add object-test
and link-test to activitystreams2_test
This commit is contained in:
parent
a110c73978
commit
84ae5642bb
3 changed files with 14 additions and 4 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -14,4 +14,5 @@ pom.xml.asc
|
||||||
.clj-kondo/.cache/
|
.clj-kondo/.cache/
|
||||||
.clj-kondo/metosin/
|
.clj-kondo/metosin/
|
||||||
.lsp/.cache/
|
.lsp/.cache/
|
||||||
.calva
|
.calva
|
||||||
|
.idea
|
|
@ -19,6 +19,7 @@
|
||||||
"Relationship"
|
"Relationship"
|
||||||
"Tombstone"
|
"Tombstone"
|
||||||
"Video"
|
"Video"
|
||||||
|
"Link"
|
||||||
; Link Types
|
; Link Types
|
||||||
"Mention"})
|
"Mention"})
|
||||||
|
|
||||||
|
@ -30,7 +31,8 @@
|
||||||
:uri core/uri-string?
|
:uri core/uri-string?
|
||||||
:map (s/and (s/keys
|
:map (s/and (s/keys
|
||||||
:req-un [::id ::type]
|
:req-un [::id ::type]
|
||||||
:opt-un [::attributedTo ::content ::und-mehr]))))
|
:opt-un [::attributedTo ::und-mehr]))))
|
||||||
|
|
||||||
(s/def ::id core/uri-string?)
|
(s/def ::id core/uri-string?)
|
||||||
|
|
||||||
; TODO: type can have multiple values!! Affects also the fct match-type and all specs that uses it!
|
; TODO: type can have multiple values!! Affects also the fct match-type and all specs that uses it!
|
||||||
|
|
|
@ -8,10 +8,17 @@
|
||||||
(deftest id-test
|
(deftest id-test
|
||||||
(is (s/valid? ::sut/id "https://social.bla/alyssa/status/RANDOMHASH")))
|
(is (s/valid? ::sut/id "https://social.bla/alyssa/status/RANDOMHASH")))
|
||||||
|
|
||||||
|
(deftest type-test
|
||||||
|
(is (s/valid? ::sut/type "Note"))
|
||||||
|
(is (s/valid? ::sut/type "Link"))
|
||||||
|
(is (not(s/valid? ::sut/type "non existing"))))
|
||||||
|
|
||||||
|
(deftest object-test
|
||||||
|
(is (s/valid? ::sut/Object "https://social.bla/alyssa/status/RANDOMHASH")
|
||||||
|
(is (s/valid? ::sut/Object {:id "https://social.bla/alyssa/status/RANDOMHASH" :type "Page"}))))
|
||||||
|
|
||||||
|
(deftest link-test
|
||||||
|
(is (s/valid? ::sut/Link {:type "Link"})))
|
||||||
|
|
||||||
;(deftest Note-test
|
;(deftest Note-test
|
||||||
; (is (s/valid?
|
; (is (s/valid?
|
||||||
|
|
Loading…
Reference in a new issue