diff --git a/apps/andi/test/unit/andi_web/live/dataset_live_view/table_test.exs b/apps/andi/test/unit/andi_web/live/dataset_live_view/table_test.exs index d4087b616..d6b209369 100644 --- a/apps/andi/test/unit/andi_web/live/dataset_live_view/table_test.exs +++ b/apps/andi/test/unit/andi_web/live/dataset_live_view/table_test.exs @@ -2,6 +2,7 @@ defmodule AndiWeb.DatasetLiveViewTest.TableTest do use AndiWeb.Test.AuthConnCase.UnitCase use Placebo alias Andi.Schemas.User + alias Andi.InputSchemas.MessageErrors import Phoenix.LiveViewTest @@ -45,6 +46,11 @@ defmodule AndiWeb.DatasetLiveViewTest.TableTest do allow(Andi.Repo.all(any()), return: [dataset_a, dataset_b, dataset_c, dataset_d]) + allow(MessageErrors.get_latest_error(dataset_a.id), return: create_message_error(dataset_a.id)) + allow(MessageErrors.get_latest_error(dataset_b.id), return: create_message_error(dataset_b.id)) + allow(MessageErrors.get_latest_error(dataset_c.id), return: create_message_error(dataset_c.id)) + allow(MessageErrors.get_latest_error(dataset_d.id), return: create_message_error(dataset_d.id)) + {:ok, view, _} = get(conn, @url_path) |> live() @@ -165,4 +171,12 @@ defmodule AndiWeb.DatasetLiveViewTest.TableTest do end) end) end + + defp create_message_error(dataset_id) do + %{ + dataset_id: dataset_id, + has_current_error: false, + last_error_time: DateTime.from_unix!(0) + } + end end