Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 51 additions & 5 deletions api/fep_ae0c_characterization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ func TestFEPAE0CTraditionalPublicAudienceFixtures(t *testing.T) {
)
})
addFEPTraditionalReceiver(t, receiverDomain)

activity, body := fixtureActivity(t, identifier)
actor := actorForFixtureActivity(t, activity, "Person")
recorder := postFEPAE0CFixture(t, activity, actor, body)
Expand All @@ -373,9 +372,36 @@ func TestFEPAE0CTraditionalPublicAudienceFixtures(t *testing.T) {
http.StatusAccepted,
)
}
waitForFEPStoredBody(t, body)

objectID, err := activity.UnwrapInnerObjectId()
if err != nil {
t.Fatalf("fixture object ID: %v", err)
}
_, targetCount, found := waitForRelayWrapper(
t,
objectID,
)
if !found {
t.Fatal(
"unsigned fixture did not produce relay-authored Announce",
)
}
if targetCount < 1 {
t.Fatalf(
"relay Announce target count = %d; want at least 1",
targetCount,
)
}
if storedRelayBodyEquals(t, body) {
t.Fatal(
"unsigned fixture body must not be forwarded unchanged",
)
}
if !RelayState.IsPublisher(sourceDomain) {
t.Fatalf("source %s was not recorded as publisher", sourceDomain)
t.Fatalf(
"source %s was not recorded as publisher",
sourceDomain,
)
}
})
}
Expand Down Expand Up @@ -507,7 +533,6 @@ func TestFEPAE0COpenPublisherCreate(t *testing.T) {
activity, body := fixtureActivity(t, "open-publisher-public-create")
actor := actorForFixtureActivity(t, activity, "Person")
recorder := postFEPAE0CFixture(t, activity, actor, body)

if recorder.Code != http.StatusAccepted {
t.Fatalf(
"status = %d; want %d",
Expand All @@ -522,7 +547,28 @@ func TestFEPAE0COpenPublisherCreate(t *testing.T) {
sourceDomain,
)
}
waitForFEPStoredBody(t, body)

objectID, err := activity.UnwrapInnerObjectId()
if err != nil {
t.Fatalf("fixture object ID: %v", err)
}
_, targetCount, found := waitForRelayWrapper(t, objectID)
if !found {
t.Fatal(
"unsigned open-publisher fixture did not produce relay Announce",
)
}
if targetCount < 1 {
t.Fatalf(
"relay Announce target count = %d; want at least 1",
targetCount,
)
}
if storedRelayBodyEquals(t, body) {
t.Fatal(
"unsigned open-publisher body must not be forwarded unchanged",
)
}
if !RelayState.IsPublisher(sourceDomain) {
t.Fatalf("open publisher %s was not recorded", sourceDomain)
}
Expand Down
Loading