feat(import): serve dynamic CSV import templates reflecting current custom fields

This commit is contained in:
Moritz 2026-06-03 02:21:36 +02:00
parent 00e1624ee4
commit a93dd9d535
5 changed files with 238 additions and 13 deletions

View file

@ -240,10 +240,15 @@ defmodule MvWeb.ImportLiveTest do
assert has_element?(view, "[data-testid='start-import-button']")
end
test "template links and file input are present", %{conn: conn} do
test "template links point to the dynamic import template routes", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/admin/import")
assert has_element?(view, "a[href='/admin/import/template/en']")
assert has_element?(view, "a[href='/admin/import/template/de']")
refute has_element?(view, "a[href*='/templates/member_import_en.csv']")
end
test "file input is present", %{conn: conn} do
{:ok, view, _html} = live(conn, ~p"/admin/import")
assert has_element?(view, "a[href*='/templates/member_import_en.csv']")
assert has_element?(view, "a[href*='/templates/member_import_de.csv']")
assert has_element?(view, "label[for='csv_file']")
assert has_element?(view, "#csv_file_help")
assert has_element?(view, "[data-testid='csv-upload-form'] input[type='file']")