ActivityPub § 5.5 Liked Collection:
Every object MAY have a liked collection. … The liked collection MUST be either an OrderedCollection or a Collection
This is a Test Case describing a rule to determine whether an ActivityPub Object is in partial conformance with the following behaviors required by ActivityPub.
The identifier of this test is urn:uuid:018c3df2-d6d8-7f62-805b-b71a96cc6170
.
The subject of this test is an ActivityPub Object.
This test requires the following inputs indicating parts of the test subject:
object
- the object whose liked
property will be tested
This test applies to each of the liked collections derived from the values of the property on object
named liked
.
object
is a JSON objectobject
JSON object has a property named liked
targets
be a setlikedValues
be the result of
object.liked
is an Array, return itobject.liked
likedValues
targets
targets
targets
For every target target
target
is a JSON objecttarget
has a property named type
target
's type
property must be one of
What follows are some specific cases of applything this test.
inputs
object
:
{
"liked": {
"type": "Collection"
}
}
test targets
{
"type": "Collection"
}
passed
inputs
object
:
{
"liked": {
"type": "OrderedCollection"
}
}
test targets
{
"type": "OrderedCollection"
}
passed
inputs
object
:
{
"liked": {
"type": ["FancyCollection", "OrderedCollection"]
}
}
test targets
{
"type": ["FancyCollection", "OrderedCollection"]
}
passed
"FancyCollection"
is not well-defined here, but this object still passes the test because at least one of the type
property values is OrderedCollection
and thus satisfies the requirement as interpreted.inputs
object
:
{
"liked": 1
}
test targets
1
failed
inputs
object
:
{
"liked": {}
}
test targets
{}
failed
"Link"
inputs
object
:
{
"liked": {
"type": ["Link"]
}
}
test targets
{
"type": ["Link"]
}
failed
inputs
object
:
1
result
inapplicable
inputs
object
:
{ "foo": "bar" }
result
inapplicable
outcome
An outcome is a conclusion that comes from evaluating a test on a test subject. An outcome can be one of the three following types:
inapplicable
: No part of the test subject matches the applicabilitypassed
: A test target meets all expectationsfailed
: A test target does not meet all expectationspassed
, the requirement is satisfied by the test subjectfailed
, the requirement is not satisfied by the test subjectinapplicable
, further testing is needed to determine requirement satisfaction