mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-03-18 05:12:10 -04:00
This PR is part of #4767. It contains * add log to federation services * separat test package for test (fix dependency cycles) Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10371 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de> Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
29 lines
666 B
Go
29 lines
666 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_UserActivityNoteValidation(t *testing.T) {
|
|
sut := forgefed.ForgeUserActivityNote{}
|
|
sut.Type = "Note"
|
|
sut.Content = ap.NaturalLanguageValues{
|
|
{
|
|
Ref: ap.NilLangRef,
|
|
Value: ap.Content("Any Content!"),
|
|
},
|
|
}
|
|
sut.URL = ap.IRI("example.org/user-id/57")
|
|
|
|
valid, _ := validation.IsValid(sut)
|
|
assert.True(t, valid, "sut expected to be valid: %v\n", sut.Validate())
|
|
}
|