|
|
@ -8,15 +8,21 @@ defmodule DecentralisedBookIndex.Sync.DataTransformers.AuthorTransformerTest do
|
|
|
|
json_body = %{
|
|
|
|
json_body = %{
|
|
|
|
"data" => %{
|
|
|
|
"data" => %{
|
|
|
|
"attributes" => %{
|
|
|
|
"attributes" => %{
|
|
|
|
|
|
|
|
"author_alias_registry_id" => "1320a6fe-b311-45ac-bbaa-39cf29c44624",
|
|
|
|
|
|
|
|
"avatar_url" => "/images/avatar.png",
|
|
|
|
|
|
|
|
"dbi_server_id" => "889a323e-d104-4b5d-b276-dad5a9b1da99",
|
|
|
|
"description" => "Something",
|
|
|
|
"description" => "Something",
|
|
|
|
|
|
|
|
"inserted_at" => "2025-03-25T19:19:15.187456Z",
|
|
|
|
"name" => "Author",
|
|
|
|
"name" => "Author",
|
|
|
|
"avatar_url" => "/images/avatar.png",
|
|
|
|
"updated_at" => "2025-03-26T10:16:16.124581Z"
|
|
|
|
"author_alias_registry_id" => "1320a6fe-b311-45ac-bbaa-39cf29c44624"
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"id" => "889a323e-d104-4b5d-b276-dad5a9b1da9d",
|
|
|
|
"id" => "889a323e-d104-4b5d-b276-dad5a9b1da9d",
|
|
|
|
"links" => %{},
|
|
|
|
"links" => %{},
|
|
|
|
"meta" => %{},
|
|
|
|
"meta" => %{},
|
|
|
|
"relationships" => %{},
|
|
|
|
"relationships" => %{
|
|
|
|
|
|
|
|
"author_alias_registry" => %{"links" => %{}, "meta" => %{}},
|
|
|
|
|
|
|
|
"dbi_server" => %{"links" => %{}, "meta" => %{}}
|
|
|
|
|
|
|
|
},
|
|
|
|
"type" => "author"
|
|
|
|
"type" => "author"
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"jsonapi" => %{"version" => "1.0"},
|
|
|
|
"jsonapi" => %{"version" => "1.0"},
|
|
|
@ -34,22 +40,31 @@ defmodule DecentralisedBookIndex.Sync.DataTransformers.AuthorTransformerTest do
|
|
|
|
name: "Author",
|
|
|
|
name: "Author",
|
|
|
|
description: "Something",
|
|
|
|
description: "Something",
|
|
|
|
avatar_url: "/images/avatar.png",
|
|
|
|
avatar_url: "/images/avatar.png",
|
|
|
|
author_alias_registry_id: "1320a6fe-b311-45ac-bbaa-39cf29c44624"
|
|
|
|
author_alias_registry_id: "1320a6fe-b311-45ac-bbaa-39cf29c44624",
|
|
|
|
|
|
|
|
dbi_server_id: "889a323e-d104-4b5d-b276-dad5a9b1da99",
|
|
|
|
|
|
|
|
inserted_at: "2025-03-25T19:19:15.187456Z",
|
|
|
|
|
|
|
|
updated_at: "2025-03-26T10:16:16.124581Z"
|
|
|
|
} = author
|
|
|
|
} = author
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
test "a json doesn't contains author information \"data\" attribute" do
|
|
|
|
test "a json doesn't contains author information \"data\" attribute" do
|
|
|
|
json_body = %{
|
|
|
|
json_body = %{
|
|
|
|
"attributes" => %{
|
|
|
|
"attributes" => %{
|
|
|
|
|
|
|
|
"author_alias_registry_id" => "1320a6fe-b311-45ac-bbaa-39cf29c44624",
|
|
|
|
|
|
|
|
"avatar_url" => "/images/avatar.png",
|
|
|
|
|
|
|
|
"dbi_server_id" => "889a323e-d104-4b5d-b276-dad5a9b1da99",
|
|
|
|
"description" => "Something",
|
|
|
|
"description" => "Something",
|
|
|
|
|
|
|
|
"inserted_at" => "2025-03-25T19:19:15.187456Z",
|
|
|
|
"name" => "Author",
|
|
|
|
"name" => "Author",
|
|
|
|
"avatar_url" => "/images/avatar.png",
|
|
|
|
"updated_at" => "2025-03-26T10:16:16.124581Z"
|
|
|
|
"author_alias_registry_id" => "1320a6fe-b311-45ac-bbaa-39cf29c44624"
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
"id" => "889a323e-d104-4b5d-b276-dad5a9b1da9d",
|
|
|
|
"id" => "889a323e-d104-4b5d-b276-dad5a9b1da9d",
|
|
|
|
"links" => %{},
|
|
|
|
"links" => %{},
|
|
|
|
"meta" => %{},
|
|
|
|
"meta" => %{},
|
|
|
|
"relationships" => %{},
|
|
|
|
"relationships" => %{
|
|
|
|
|
|
|
|
"author_alias_registry" => %{"links" => %{}, "meta" => %{}},
|
|
|
|
|
|
|
|
"dbi_server" => %{"links" => %{}, "meta" => %{}}
|
|
|
|
|
|
|
|
},
|
|
|
|
"type" => "author"
|
|
|
|
"type" => "author"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -60,7 +75,10 @@ defmodule DecentralisedBookIndex.Sync.DataTransformers.AuthorTransformerTest do
|
|
|
|
name: "Author",
|
|
|
|
name: "Author",
|
|
|
|
description: "Something",
|
|
|
|
description: "Something",
|
|
|
|
avatar_url: "/images/avatar.png",
|
|
|
|
avatar_url: "/images/avatar.png",
|
|
|
|
author_alias_registry_id: "1320a6fe-b311-45ac-bbaa-39cf29c44624"
|
|
|
|
author_alias_registry_id: "1320a6fe-b311-45ac-bbaa-39cf29c44624",
|
|
|
|
|
|
|
|
dbi_server_id: "889a323e-d104-4b5d-b276-dad5a9b1da99",
|
|
|
|
|
|
|
|
inserted_at: "2025-03-25T19:19:15.187456Z",
|
|
|
|
|
|
|
|
updated_at: "2025-03-26T10:16:16.124581Z"
|
|
|
|
} = author
|
|
|
|
} = author
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|