Skip to content

Commit

Permalink
Merge pull request #86 from yetanalytics/allow-empty-statements
Browse files Browse the repository at this point in the history
[LRS-83] Allow empty statement batches
  • Loading branch information
kelvinqian00 authored Sep 24, 2024
2 parents 5869bf7 + 63614c7 commit a1386be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xapi_schema/spec.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@
true)))))

(s/def ::statements
(s/coll-of ::statement :into [] :min-count 1))
(s/coll-of ::statement :into []))

(s/def ::lrs-statements
(s/coll-of ::lrs-statement :into [] :min-count 1))
(s/coll-of ::lrs-statement :into []))
11 changes: 11 additions & 0 deletions test/xapi_schema/spec_test.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -626,3 +626,14 @@
"verb" {"id" "http://adlnet.gov/expapi/verbs/voided"
"display" {"en-US" "voided"}}
"object" {"id" "http://example.com/activities/1"}})))

(deftest statements-test
(testing "generic statememt batch"
(should-satisfy+ ::xs/statements
[simple-statement]
[simple-statement long-statement]
[]))
(testing "LRS retrieval statement batch"
(should-satisfy+ ::xs/lrs-statements
[d/statement] ; This statement has ID and other required fields
[])))

0 comments on commit a1386be

Please sign in to comment.