jojo/modules/forgefed/activity_user_activity_test.go
famfo 2fc3144de4 chore: update github.com/go-ap/activitypub to 902f6cf (#11301)
Picks the update commit from https://codeberg.org/forgejo/forgejo/pulls/11200 and fixes the new incompatibilities.

I ran full end-to-end tests against Forgejo and basic end-to-end tests against GoToSocial which appear to be working.

Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/11301
Reviewed-by: elle <0xllx0@noreply.codeberg.org>
Co-authored-by: famfo <famfo@famfo.xyz>
Co-committed-by: famfo <famfo@famfo.xyz>
2026-04-02 23:57:13 +02:00

38 lines
935 B
Go

// Copyright 2025 The Forgejo Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package forgefed_test
import (
"testing"
"forgejo.org/modules/forgefed"
"forgejo.org/modules/validation"
ap "github.com/go-ap/activitypub"
"github.com/stretchr/testify/assert"
)
func Test_ForgeUserActivityValidation(t *testing.T) {
note := forgefed.ForgeUserActivityNote{}
note.Type = ap.NoteType
note.Content = ap.NaturalLanguageValues{
ap.NilLangRef: ap.Content("Any Content!"),
}
note.URL = ap.IRI("example.org/user-id/57")
sut := forgefed.ForgeUserActivity{}
sut.Type = ap.CreateType
sut.Actor = ap.IRI("example.org/user-id/23")
sut.CC = ap.ItemCollection{
ap.IRI("example.org/registration/public#2nd"),
}
sut.To = ap.ItemCollection{
ap.IRI("example.org/registration/public"),
}
sut.Note = note
valid, _ := validation.IsValid(sut)
assert.True(t, valid, "sut expected to be valid: %v\n", sut.Validate())
}