From 310fced049ccb77039e7e91ca70598d0ac90b983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lui=CC=81s=20Arteiro?= Date: Tue, 24 Jan 2023 20:36:05 +0000 Subject: [PATCH] feat: Adding test for tag. #256 --- test/app/tag_test.exs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/app/tag_test.exs b/test/app/tag_test.exs index a351640b..0facb9b5 100644 --- a/test/app/tag_test.exs +++ b/test/app/tag_test.exs @@ -59,4 +59,16 @@ defmodule App.TagTest do assert {:ok, _etc} = Tag.delete_tag(tag) end end + + describe "List tags" do + @valid_attrs %{text: "tag1", person_id: 1, color: "#FCA5A5"} + + test "list_person_tags_text/0 returns the tags texts" do + {:ok, tag} = Tag.create_tag(@valid_attrs) + tags_text_array = Tag.list_person_tags_text(@valid_attrs.person_id) + assert length(tags_text_array) == 1 + assert Enum.at(tags_text_array, 0) == @valid_attrs.text + end + end + end