test: adds tests
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
carla 2026-02-04 16:43:12 +01:00
parent c82f4b7fd7
commit b429a4dbb6
6 changed files with 391 additions and 59 deletions

View file

@ -19,6 +19,7 @@ defmodule MvWeb.ImportExportLiveTest do
end
describe "Import/Export LiveView" do
@describetag :ui
setup %{conn: conn} do
admin_user = Mv.Fixtures.user_with_role_fixture("admin")
conn = MvWeb.ConnCase.conn_with_password_user(conn, admin_user)
@ -45,6 +46,7 @@ defmodule MvWeb.ImportExportLiveTest do
end
describe "CSV Import Section" do
@describetag :ui
setup %{conn: conn} do
admin_user = Mv.Fixtures.user_with_role_fixture("admin")
conn = MvWeb.ConnCase.conn_with_password_user(conn, admin_user)
@ -524,6 +526,7 @@ defmodule MvWeb.ImportExportLiveTest do
# Verified by import-results-panel existence above
end
@tag :ui
test "A11y: file input has label", %{conn: conn} do
{:ok, _view, html} = live(conn, ~p"/admin/import-export")
@ -532,6 +535,7 @@ defmodule MvWeb.ImportExportLiveTest do
html =~ ~r/<label[^>]*>.*CSV File/i
end
@tag :ui
test "A11y: status/progress container has aria-live", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/admin/import-export")
@ -540,6 +544,7 @@ defmodule MvWeb.ImportExportLiveTest do
assert html =~ ~r/aria-live=["']polite["']/i
end
@tag :ui
test "A11y: links have descriptive text", %{conn: conn} do
{:ok, _view, html} = live(conn, ~p"/admin/import-export")
@ -642,6 +647,7 @@ defmodule MvWeb.ImportExportLiveTest do
html =~ "Failed to prepare"
end
@tag :ui
test "wrong file type (.txt): upload shows error", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/admin/import-export")
@ -659,6 +665,7 @@ defmodule MvWeb.ImportExportLiveTest do
assert html =~ "CSV" or html =~ "csv" or html =~ ".csv"
end
@tag :ui
test "file input has correct accept attribute for CSV only", %{conn: conn} do
{:ok, _view, html} = live(conn, ~p"/admin/import-export")

View file

@ -61,7 +61,7 @@ defmodule MvWeb.ProfileNavigationTest do
end
@tag :skip
# TODO: Implement user initials in navbar avatar - see issue #170
# Note: User initials in navbar avatar - see issue #170
test "shows user initials in avatar", %{conn: conn} do
# Setup: Create and login a user
user = create_test_user(%{email: "test.user@example.com"})