defmodule Outlook.ArticlesFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Outlook.Articles` context.
"""
# TODO: make this work
@doc """
Generate a article.
"""
def article_fixture(attrs \\ %{}) do
{:ok, article} =
attrs
|> Enum.into(%{
content: [%Outlook.InternalTree.InternalNode{name: "p", attributes: %{}, type: :element, nid: "54e8cedb-6459-4605-8301-367758675bb8", content: [
%Outlook.InternalTree.TranslationUnit{status: :untranslated, nid: "c0fcdf61-ae2d-482e-81b4-9b6e3baacd8b",
content: "A sentence with many letters and many, many words. "},
%Outlook.InternalTree.TranslationUnit{status: :untranslated, nid: "eac12d97-623d-4237-9f33-666298c7f494",
content: "A sentence with many letters and many, many words. "}],
eph: %{sibling_with: :block}}],
date: ~U[2022-12-25 16:16:00Z],
language: "EN",
title: "some title",
url: "some url",
author_id: 1
})
|> Outlook.Articles.create_article()
article
end
end