mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
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>
31 lines
765 B
Go
31 lines
765 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_NewForgeFollowValidation(t *testing.T) {
|
|
sut := forgefed.ForgeFollow{}
|
|
sut.Type = ap.FollowType
|
|
sut.Actor = ap.IRI("example.org/alice")
|
|
sut.Object = ap.IRI("example.org/bob")
|
|
|
|
valid, err := validation.IsValid(sut)
|
|
assert.True(t, valid, "sut is invalid: %v\n", err)
|
|
|
|
sut = forgefed.ForgeFollow{}
|
|
sut.Actor = ap.IRI("example.org/alice")
|
|
sut.Object = ap.IRI("example.org/bob")
|
|
|
|
valid, err = validation.IsValid(sut)
|
|
assert.False(t, valid, "sut is valid: %v\n", err)
|
|
}
|