feat(import): confirm column mapping in a preview before importing members

This commit is contained in:
Moritz 2026-06-03 02:25:50 +02:00
parent a93dd9d535
commit 68a1a9530a
8 changed files with 816 additions and 38 deletions

View file

@ -0,0 +1,31 @@
defmodule MvWeb.ImportLive.ComponentsTest do
use ExUnit.Case, async: true
alias MvWeb.ImportLive.Components
describe "import_button_disabled?/2" do
@done_entry %{done?: true}
test "disables the Start Import button while the preview is displayed" do
# During :preview the upload entry is done, but re-clicking Start Import
# would re-run the upload processing and overwrite the current preview.
assert Components.import_button_disabled?(:preview, [@done_entry]) == true
end
test "disables the button while an import is running" do
assert Components.import_button_disabled?(:running, [@done_entry]) == true
end
test "disables the button when there are no upload entries" do
assert Components.import_button_disabled?(:idle, []) == true
end
test "disables the button while an upload entry is not yet done" do
assert Components.import_button_disabled?(:idle, [%{done?: false}]) == true
end
test "enables the button at idle with a completed upload" do
assert Components.import_button_disabled?(:idle, [@done_entry]) == false
end
end
end