X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fpleroma%2Fweb%2Factivity_pub%2Fobject_validators%2Farticle_note_page_validator_test.exs;h=62ac5e0510ff3f32afbe1bed6997ab4ed13e9811;hb=90088cce11cf2d636f2741b2e340ae9dc518406d;hp=0ddc3c76d1525340153b8bd55b5f47d9f251a5f5;hpb=e49b583147748be73062acc92ea510f6f55a503a;p=akkoma diff --git a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs index 0ddc3c76d..62ac5e051 100644 --- a/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs +++ b/test/pleroma/web/activity_pub/object_validators/article_note_page_validator_test.exs @@ -28,7 +28,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest "to" => [user.follower_address], "cc" => [], "content" => "Hellow this is content.", - "published" => "2021-01-01T00:00:00Z", "context" => "xxx", "summary" => "a post" } @@ -40,6 +39,20 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest %{valid?: true} = ArticleNotePageValidator.cast_and_validate(note) end + test "a note with a language validates" do + insert(:user, %{ap_id: "https://mastodon.social/users/akkoma_ap_integration_tester"}) + note = File.read!("test/fixtures/mastodon/note_with_language.json") |> Jason.decode!() + + %{ + valid?: true, + changes: %{ + contentMap: %{ + "ja" => "

tag

" + } + } + } = ArticleNotePageValidator.cast_and_validate(note) + end + test "a note from factory validates" do note = insert(:note) %{valid?: true} = ArticleNotePageValidator.cast_and_validate(note.data) @@ -66,12 +79,6 @@ defmodule Pleroma.Web.ActivityPub.ObjectValidators.ArticleNotePageValidatorTest ArticleNotePageValidator.cast_and_validate(note) end - test "a note without a published field should not validate", _ do - insert(:user, %{ap_id: "http://mastodon.example.org/users/admin"}) - note = Jason.decode!(File.read!("test/fixtures/mastodon/note-without-published.json")) - %{valid?: false} = ArticleNotePageValidator.cast_and_validate(note) - end - test "a note with an attachment should work", _ do insert(:user, %{ap_id: "https://owncast.localhost.localdomain/federation/user/streamer"})